ideas-cli
v0.1.3
Published
Local-first ideas CLI with markdown storage and AI helpers
Downloads
34
Readme
ideas-cli
ideas is a local-first command-line tool for capturing ideas as Markdown on disk—no server, no database. Optional helpers call models through the Vercel AI Gateway (via the ai SDK) to expand or rewrite note bodies using your own context files.
What it does
- Stores ideas under a configurable home directory (default
~/.ideas) as.mdfiles with YAML frontmatter (id,title,slug,stage, timestamps). - Stages workflow: each idea lives in inbox → drafts → posts (
promotemoves files between folders and updates frontmatter). - Lists and opens ideas in a table; you can pass an id or use an interactive picker when stdin/stdout are a TTY.
- AI (optional):
expandturns a rough note into a structured outline;rewriteimproves clarity while preserving meaning. Both merge optional Markdown fromcontext/into the prompt.context buildprints or writes that merged context for inspection or reuse.
How it works
Initialization —
ideas initcreatesconfig/,inbox/,drafts/,posts/,context/,scratch/,templates/, writesconfig/config.json(defaults for editor and AI model ids), andconfig/models.json(registry snapshot; reserved for future use).Files — New ideas are saved as
{id}-{slug}.mdininbox/. Theidis a 16-byte hex string. Bodies are Markdown after the frontmatter (parsed with gray-matter).Config —
config.jsonis validated with Zod. Paths like~/.ideasare expanded from the home directory. Override the root withIDEAS_HOME(used when resolvingconfig.jsonlocation at bootstrap).Environment — Before commands run, the CLI loads env files in order without overriding existing variables:
./.env.local,./.env, then~/.ideas/.env. This helps GUI apps and editors that do not load your shell profile.AI —
expand/rewritecallgenerateTextfrom theaipackage with a model id string (e.g.anthropic/claude-sonnet-4.6). The gateway expectsAI_GATEWAY_API_KEY. Model ids per task come fromconfig.ai.models.expandandconfig.ai.models.rewrite(see defaults in the repo’ssrc/lib/config.ts).Context merge — If present, these files under
context/are concatenated into the prompt with headings:profile.md,voice.md,themes.md,projects.md,examples.md.ideas context build --source <file>appends an extra Source section from that file.Build — The published binary is a single ESM bundle from
src/bin/ideas.ts(tsup), shebanged fornode.
For broader design goals and a longer-term command list, see SPEC.md. The CLI currently implements the commands below; other commands listed in the spec are not shipped yet.
Requirements
- Node.js 20+
Install from npm
The package is published as ideas-cli. The ideas name on npm belongs to another project, so this CLI is not installable as npm install -g ideas.
npm install -g ideas-cliAfter install, the command you run is still ideas (see Quick start).
Install (local / dev)
npm install
npm run buildRun the CLI:
node dist/ideas.js --helpLink globally (optional):
npm link
ideas --helpQuick start
ideas init
ideas add "My first idea" --body "Some notes"
ideas list
ideas promote <id> # or: ideas promote (interactive picker)
ideas open <id> # or: ideas open (interactive picker)AI commands
Set AI_GATEWAY_API_KEY (from the Vercel dashboard for AI Gateway). Optionally pin models:
ideas configure --model-expand openai/gpt-5.4 --model-rewrite openai/gpt-5.4ideas expand <id> # print to stdout
ideas expand <id> --write # replace idea body with output
ideas rewrite <id>
ideas rewrite <id> --write
ideas context build --source path/to/file.md -o /tmp/context.mdOptional context files: ~/.ideas/context/profile.md, voice.md, themes.md, projects.md, examples.md (paths follow IDEAS_HOME if set).
Environment
| Variable | Description |
|----------|-------------|
| IDEAS_HOME | Root directory for config and data (default: ~/.ideas). |
| AI_GATEWAY_API_KEY | Required for expand and rewrite. |
Scripts
| Script | Description |
|--------|-------------|
| npm run build | Bundle CLI with tsup (dist/ideas.js) |
| npm run dev | Run CLI with tsx (src/bin/ideas.ts) |
| npm test | Vitest |
| npm run release | changeset publish |
Layout
See SPEC.md for the full directory layout and principles.
