今日已更新 240 条资讯 | 累计 23823 条内容
关于我们

标签:#cli

找到 211 篇相关文章

AI 资讯

Deterministic Tool Adoption Gates: Score It, Don't Vibe It

Originally published on hexisteme notes . A new public repo showed up on 2026-07-14: mattpocock/skills , an MIT-licensed collection of Claude Code agent skills. It's the kind of thing that's easy to fall for in the first ten minutes — skim the READMEs, install the ones that sound useful, move on. I didn't do that. I ran it through the five deterministic gates in my adoption CLI, the same gates every Swift package and npm dependency in my stack has had to clear, extended for the first time to cover a Claude skill. The reason I bother with this at all: adoption decisions rot when they're vibes. "This looks solid" is not a claim you can revisit in six months and check whether you were right about. A score is. So is a pre-registered condition for when you'd bail on it. The rest of this post is what that machinery produced on a real decision, not a hypothetical one. Five gates, one score The CLI scores any candidate — package, library, or now, skill — on five gates: maturity (how long has this actually existed), dependency footprint (what does adopting it drag in), platform fit (native or third-party, and documented or not), policy and developer experience (documentation quality plus release stability), and trajectory (is it actively maintained right now). Each gate contributes points toward a 100-point total, and fixed thresholds turn that total into a verdict: ADOPT at 80 or above, TRIAL at 60 or above, HOLD at 40 or above, reject below that. No gate is a gut check — every one resolves to a number from a query I can rerun. Here's what mattpocock/skills scored, evaluated as of 2026-07-14: Gate Score Why G1 Maturity 4/20 First release 2026-06-17 — 27 days old at evaluation time. The repo itself was only created 2026-02-03, so the project as a whole is five months old. G2 Dependency footprint 20/20 Zero runtime dependencies. Skills are markdown prompt files — structurally, there's nothing to depend on. G3 Platform fit 10/20 Third-party, not built into the platform, but do

2026-07-25 原文 →
AI 资讯

My idle ClickHouse was merging 11 million rows every 30 seconds

I run a small self-hosted observability tool on the cheapest VPS I could find on purpose: 2 cores, 2 GB RAM, 20 GB SATA SSD . It ingests errors, traces and metrics from two low-traffic sites of mine. The stack is three containers — a Go app, PostgreSQL, and ClickHouse. One evening docker stats showed ClickHouse sitting on 880 MB of its 1 GB limit and the box swapping, with basically zero events coming in. So I went looking for where the memory and disk had gone. The answer turned out to be a good lesson in how a database can spend almost all of its I/O talking to itself. 543 KB of my data, 579 MB of ClickHouse talking about ClickHouse First thing I checked: how much data had my app actually stored versus how much ClickHouse had stored about itself . My application database: 543 KB, 16k rows The system database: 579 MB, 46.3M rows Roughly a thousand to one. Disk was 12 GB used out of 20 — on a tool that had recorded half a megabyte of real telemetry. The culprit was ClickHouse's own system logs, several of which have no TTL by default and therefore grow forever: trace_log — 404 MB, 26M rows (the query profiler writes here; it's on by default, sampling once per second) asynchronous_metric_log — 16.6M rows text_log — 132 MB plus query_log , latency_log Only metric_log , processors_profile_log and part_log ship with a TTL. Everything else just accumulates. Then I looked at the insert rate over 30 seconds: trace_log — 227 rows/s asynchronous_metric_log — 157 rows/s text_log — 44 rows/s my application — about 5 rows/s 98.8% of all inserts were ClickHouse narrating its own internals. The part that's expensive beyond disk Here's the number that made me stop. Over the same 30 seconds: rows inserted : 16,222 rows merged : 11,007,643 That's a 1 : 678 ratio. For every row written, the engine rewrote 678 already-sitting rows. The mechanics: MergeTree drops every insert into its own data part, then merges parts into bigger ones so reads stay fast. When the table is small this is

2026-07-25 原文 →
AI 资讯

We Spent Months Cleaning SEC EDGAR 13F Data So You Don't Have To

The data isn't the hard part. Cleaning it is. SEC EDGAR is public, free, and a mess. Every quarter, 13,000+ institutional investment managers file Form 13F, disclosing their U.S. equity holdings. In theory that's a beautiful dataset — every hedge fund, every pension fund, every bank, all in one place. In practice, the raw filings actively fight you: The same institution files under different names, sometimes even in the same quarter. In our own database right now: BlackRock, Inc. and BlackRock Inc. are two distinct CIK registrations for what most people would call "one" institution. Multiply that across 13,000+ filers and you get a long tail of near-duplicate names that break any naive GROUP BY institution_name . CUSIPs don't map cleanly to tickers. Foreign issuers frequently use CUSIP prefixes that don't resolve through the usual reference data — we ended up building a fallback resolution path (Yahoo Finance lookups plus manual validation rules) just to keep ticker coverage from silently degrading over time. Quarters arrive gradually, not all at once. The SEC gives managers up to 45 days after quarter-end to file. If you naively take "the latest quarter with any data" as your reporting period, you'll rank a barely-started quarter — where only a handful of small filers have reported so far — ahead of the real, complete prior quarter. We learned this the hard way: an unclamped "most recent quarter" query once let 115 newly-onboarded institutions' entire existing portfolios get counted as "new inflow" with nothing to offset them, because a first-time filer has no prior-quarter row to diff against. That's the kind of bug that doesn't throw an error — it just quietly produces a chart that looks plausible and is wrong. Amendments (13F-A) revise, replace, or partially restate earlier filings , and the XML schema itself has shifted over the years, so parsing "just the latest 13F" isn't a fixed target. None of this is exotic — it's the normal cost of working with real-world

2026-07-24 原文 →
AI 资讯

Who’s afraid of the big, bad GPU?

How does AI make you feel? Are you excited to “vibe-code” your smart home? Or anxious about all the added pollution and billions of gallons of water used by data centers? Dig a little deeper and you’ll start to question the actual value of the GPUs that underpin all the leaps and promises of generative […]

2026-07-21 原文 →
开发者

coldstart: one page after git clone

The first hour with a new repo is archaeology: open package.json , skim the Makefile, hunt for .env.example , grep workflows for secrets. , check Compose for ports. I already built focused tools for each of those questions. What I still wanted was one command that prints the whole map. coldstart coldstart is that overview — offline, no accounts, agent-friendly JSON. go install github.com/SybilGambleyyu/coldstart@latest coldstart coldstart -md >> ONBOARDING.md coldstart -json It reports: Runtimes — Node engines, Go version, Cargo edition, Python requires, .nvmrc , .tool-versions Run — preferred npm scripts, Makefile ## targets, just, Taskfile Ports — Compose, env *_PORT , script --port Env keys — from .env.example CI secrets/vars — from GitHub Actions workflows (builtins like GITHUB_TOKEN omitted) Overview vs drill-down Need Tool One-pager coldstart Full task map howrun Every port + live check projports Secrets vs gh secret list needsecrets Lockfile PR summary lockbrief Typical first hour: coldstart # then only if you need depth: howrun -f test projports -unique -check needsecrets -check Small binaries, MIT, no SaaS. If it saves a README scroll, it is working.

2026-07-21 原文 →
AI 资讯

ReflectionCLI 2.0: a local-first thinking CLI for AI-assisted development

The original concept behind this tool won the runner-up award for the Github CLI Challenge earlier this year. As a reminder, ReflectCLI is a tool to promote thoughtful coding through structured reflection. What does it do? Before each commit, answer reflective questions to build your personal developer knowledge dataset. The tool is local-first by design. It stores everything locally inside the current Git repo: .git/git-reflect/log.json No account, no cloud sync, no authentication, and no external AI API call. Why build it? AI-assisted development is powerful, but it can encourage cognitive offloading, letting tools do the thinking instead of developing deeper understanding. git-reflect interrupts this pattern by making reflection part of your workflow. Each answer becomes part of your personal knowledge base, documenting not just what you built, but why you built it that way and what you learned. Over time, this dataset reveals patterns in your thinking and helps you grow as a developer. If you want to read about the original tool, check out my previous post here . Since building the original version, I've spent months researching how AI changes the way developers learn, reason, and make technical decisions. Many of the ideas from those discussions have now been incorporated into ReflectionCLI 2.0. What started as a simple Git pre-commit reflection hook has evolved into a local-first thinking tool for developers working alongside AI assistants. What's New Comprehension debt tracking You can now record artifacts you shipped but don't fully understand yet. reflection debt add "Understand why the cache invalidates on user updates" \ --project api \ --tags cache,ai \ --context "AI generated most of the invalidation logic" These artifacts can easily be retrieved and resolved later. reflection debt list reflection debt resolve debt-001 Explain-back mode This workflow focuses on active recall and asks a series of questions to assess your ability to explain the piece of c

2026-07-20 原文 →
AI 资讯

Ship a Restart-Safe Upload CLI That Survives an Expired Resume URL

My upload CLI looked restart-safe until I tested two failures together: the process crashed at 63%, and the signed resume URL expired before restart. The checkpoint needs identity, not credentials: { "file" : "release.tar.gz" , "fingerprint" : "sha256:..." , "uploadId" : "up_123" , "localOffset" : 66060288 , "updatedAt" : "2026-07-19T12:00:00Z" } Do not persist the signed URL. On restart, exchange the durable upload ID for fresh authorization, query the server offset, then reconcile: const remote = await headUpload ( freshUrl ); if ( remote > file . size ) throw new Error ( " invalid remote offset " ); if ( remote !== checkpoint . localOffset ) { await saveCheckpoint ({ ... checkpoint , localOffset : remote }); } await sendFrom ( file , remote , freshUrl ); The server offset wins because a crash can occur after bytes are accepted but before the local checkpoint is renamed. Save checkpoints through write-to-temp plus atomic rename so a partial JSON file cannot destroy recovery. My fixture matrix includes: Failure Expected behavior crash after remote commit rewind/advance to remote offset expired URL refresh without creating a second upload changed local file stop on fingerprint mismatch missing remote upload ask before starting over checkpoint write interrupted retain previous valid checkpoint The tus resumable upload protocol specifies offset discovery and conflict handling that are useful even if the service uses a smaller custom protocol. The key idea is explicit reconciliation, not assuming client memory is authoritative. I also shipped upload status , upload forget , and an exportable checkpoint directory. Recovery is a user-facing feature; if users cannot inspect or remove state, “resumable” becomes hidden lock-in.

2026-07-20 原文 →
AI 资讯

Building a Small Terminal Command Helper with an LLM

I regularly lose time to terminal muscle memory. I work across Windows and Unix-like shells, so I will remember the right command in the wrong environment, transpose a Git subcommand, or use a valid binary with an invalid subcommand. The fix is usually easy to find. The interruption is the costly part: stop, search, translate the answer back into the current shell, and try again. The idea is not new. There are projects that help with failed commands, as well as terminal-integrated LLMs such as aichat. However, I wanted something that does one thing well: fix commands in a seamless workflow powered by an LLM. I wanted a deliberately narrow tool: when a command fails, suggest the command I probably meant, let me inspect it, and run it only after confirmation. During a Fable promotion period, I used an LLM coding agent to see how far a well-scoped prompt could get me. With very little steering, it produced a usable Go prototype in roughly an hour. The project is now open source: nudge . The workflow I wanted The core interaction is intentionally small: Run a command as usual. If it fails, type fix (or bare nudge ) to get a suggested correction. Review it, then press Enter to run, e to edit it first, or n to cancel. The cheapest case is a plain typo, which never reaches a model at all: PS> git pshu git: 'pshu' is not a git command. See 'git --help'. PS> fix `git pshu` isn't a valid command. Did you mean: → git push (typo fix for `git pshu`) Run it? [Enter = yes / n = no / e = edit] The (typo fix for ...) label is the tool telling me it answered locally, in under 10 ms, without a network call. The cross-shell version of the same mistake is reaching for a binary that does not exist here. Because the binary is missing, the shell's command-not-found hook fires and I do not have to type anything at all: PS> printenv `printenv` isn't a valid command. Did you mean: → Get-ChildItem env: (list all environment variables) Run it? [Enter = yes / n = no / e = edit] The case that act

2026-07-20 原文 →
AI 资讯

A tiny engine for generating file trees

I just tagged 1.0.0 of ts-treegen, a small TypeScript library for describing file structures as data and writing them to disk. If you've ever built a CLI, a scaffolding tool, or anything that needs to generate a bunch of files and folders, you know the usual approach: a pile of fs.writeFileSync calls, manual path joins, and conditional logic scattered everywhere. ts-treegen is my attempt at making that feel less like plumbing and more like just describing what you want. What it looks like import { file , dir , emit , plan } from " ts-treegen/node " ; const files = await emit ( file ( " README.md " , " # My New App " ), dir ( " src " , file ( " index.ts " , " console.log('hello'); " )), ); const p = await plan ( files , { targetDir : " ./output " }); await p . run (); file() and dir() build a tree. emit() resolves it. plan() figures out what needs to be written and gives you a chance to inspect it before anything touches disk. That's the whole API. Conditional files don't need any special syntax either. It's just JavaScript: isProd && file ( " .env.production " , " NODE_ENV=production " ); No template tags, no wrapper nodes to learn. If a value is falsy, it's filtered out. Why I built it this way The goal from the start was to keep the surface area small enough that you could hold the whole API in your head after reading the README once. I went through a few iterations before landing here, and each one was mostly about removing things rather than adding them. Conflict resolution collapsed down to a single overwrite flag. Copy helpers got cut because fs.cp already does the job. Custom error types got replaced with things you'd actually reach for in normal code. Every feature I kept had to earn its place by solving something real, not just being possible to build. Along the way the library also became runtime-agnostic. The core has zero dependencies and works against a small FileSystem interface, so I/O is fully pluggable. ts-treegen/node wires up Node's fs/promises fo

2026-07-19 原文 →
AI 资讯

How I make ffmpeg hit an exact file size (the bitrate math nobody explains)

Every few weeks I hit the same wall: I have a 300 MB screen recording, and something on the other end wants it under 8 MB . Discord, an email attachment, a bug tracker, a form that silently rejects anything bigger. The usual advice is "just use HandBrake" or "run ffmpeg with a lower CRF." But CRF doesn't take a target size — it takes a quality knob . So you export, check the size, it's 11 MB, nudge the knob, export again, now it's 5 MB and looks like a potato, nudge back… It's a binary search you run by hand, one full encode per guess. The thing is, hitting an exact size isn't a guessing game at all. It's arithmetic you can do before you encode. I ended up wrapping that arithmetic into a little Rust CLI ( DeepShrink ), but the math is the interesting part, and almost nobody writes it down. So here it is. The one insight everything rests on File size is (roughly) bitrate × duration . A bitrate is bits per second. A duration is seconds. Multiply them and the seconds cancel, leaving bits — the size of the file. That's it. That's the whole trick. Normally you treat bitrate as the input and size as whatever falls out. Flip it around: fix the size, measure the duration, and solve for the bitrate. You know the duration (ffprobe will tell you), and you know the size you want (the platform's limit). The only unknown is the bitrate — and now it's a single division away. bitrate = size_in_bits / duration_in_seconds Everything below is just this equation with the real-world messiness added back in. Building the budget, step by step Say I want a 60-second clip to fit Discord's 8 MB limit. 1. Turn the target size into bits. Sizes are in bytes, bitrate is in bits, so multiply by 8. (I'll use 1 MB = 1,000,000 bytes here to keep the mental math clean; if your platform means mebibytes, same method, different constant.) target_bits = 8_000_000 bytes × 8 = 64_000_000 bits (64 Mbit) 2. Reserve a little for container overhead. An .mp4 isn't pure video and audio — there's a container, a m

2026-07-19 原文 →