aicontext-cli
v0.1.3
Published
Local-first AI coding session recorder and handoff CLI.
Downloads
502
Maintainers
Readme
AICTX
Local-first AI coding session recorder and handoff CLI.
AICTX helps developers preserve AI-assisted development context, track visible workflow, capture command/test output, and generate compact handoffs for the next AI agent when a session ends, context is lost, or a usage limit is reached.
Install the npm package:
npm install -g aicontext-cliUse the CLI command:
aictx --helpWhy AICTX?
AI coding sessions often lose context.
You may hit a session limit, switch AI tools, restart a conversation, or need to hand work to another agent. AICTX keeps a local memory trail of what happened during development so the next AI can continue with less guessing.
AICTX can track:
AI-visible plans
AI-generated summaries
AI decisions
AI TODOs
AI next steps
changed files
commands run
errors
test output
checkpoints
handoffsAICTX does not capture hidden AI chain-of-thought. It captures visible workflow artifacts only.
Features
- Local-first project memory in
.aictx/ - SQLite-backed state
- Timeline event log
- AI handoff generation
- Compact context packs
- Transcript import/watch for visible AI chats
- Command/test output capture with
aictx run -- <command> - Workflow capture modes: transcript, shell, optional MCP
- AST symbol indexing for TypeScript projects
- Local semantic search support
- Optional Obsidian mirror
- Optional MCP server for AI tool access
- Secret redaction before storage/output
Install
Global install
npm install -g aicontext-cliThen run:
aictx --helpThe npm package name is:
aicontext-cliThe installed terminal command is:
aictxRequirements
Node.js >= 18
npm, pnpm, yarn, or bunRecommended:
Node.js 20+
pnpm 9+Quick Start
Go to a project you want to track:
cd your-projectInitialize AICTX:
aictx initStart a development session:
aictx start "Build semantic search provider system"Check status:
aictx statusGenerate a handoff:
aictx handoff --compactDaily Workflow
Recommended setup during AI-assisted development:
cd your-project
aictx init
aictx start "Implement workflow capture"In one terminal, watch project changes:
aictx watchIn another terminal, run tests/builds through AICTX:
aictx run -- pnpm test
aictx run -- pnpm buildWhen the AI session is about to end, generate handoff:
aictx handoff --compactGive the generated handoff to the next AI agent.
Command Capture
Use aictx run -- instead of running commands directly when you want output captured.
aictx run -- pnpm test
aictx run -- pnpm build
aictx run -- npm run lint
aictx run -- npx vitest --run
aictx run -- npx playwright testThe -- matters.
Everything after -- belongs to the command being captured.
Example:
aictx run -- vitest --runAICTX captures:
command
arguments
working directory
stdout summary
stderr summary
exit code
test status
errors
timeline eventTranscript Workflow Capture
AICTX can import or watch visible AI chat transcripts.
Import a transcript:
aictx transcript import ./chat.mdWatch the default transcript file:
aictx transcript watchDefault transcript path:
.aictx/inbox/current-transcript.mdWatch a custom transcript file:
aictx transcript watch ./current-ai-session.mdExtract from the configured default transcript path:
aictx transcript extractTranscript extraction can detect:
plans
summaries
decisions
TODOs
next steps
errors
mentioned files
mentioned commandsWorkflow Capture Modes
AICTX supports three workflow capture modes.
transcript
shell
mcpDefault mode:
transcriptCheck workflow status:
aictx workflow statusSet transcript mode:
aictx workflow mode transcriptSet shell mode:
aictx workflow mode shellSet MCP mode only after enabling MCP workflow writes:
aictx workflow mode mcpStart the configured workflow mode:
aictx workflow startTranscript mode
Best for capturing visible AI workflow.
AI-visible plan
AI-generated summary
AI decisions
AI TODOs
AI next steps
errors discussed in chat
files mentioned by AI
commands suggested by AIShell mode
Best for capturing technical evidence.
commands run
exit codes
test output
build output
stderr
compiler errors
lint errorsUse:
aictx run -- pnpm testMCP mode
Optional advanced mode.
Compatible AI tools can write structured workflow events directly into AICTX memory through MCP.
MCP is disabled by default.
Handoff Generation
Generate a compact handoff:
aictx handoff --compactGenerate a fuller handoff:
aictx handoffAICTX handoff can include:
session goal
current state
recent timeline
decisions
TODOs
next steps
changed files
commands run
test output
errors/blockers
symbol index summary
search hintsThe handoff is designed to be pasted into a fresh AI session.
Search
Keyword search:
aictx search "auth refresh"Semantic search:
aictx search "login fails after session expires" --semanticHybrid search:
aictx search "auth refresh bug" --hybridDirect key lookup:
aictx get decision.transformers-defaultAST Symbol Index
Build a TypeScript symbol index:
aictx symbolsAICTX can index:
functions
classes
interfaces
types
exportsThis helps AI tools find important code symbols quickly.
Embeddings
Create local semantic search embeddings:
aictx embedUse a specific provider:
aictx embed --provider transformersOptional Ollama provider:
aictx embed --provider ollamaCheck embedding status:
aictx embeddings statusAICTX should not require cloud APIs for embeddings.
Checkpoints
Save a checkpoint:
aictx checkpoint --title "Transcript parser implemented"Save a checkpoint with next step:
aictx checkpoint --title "Workflow capture scaffolded" --next "Add tests and run pnpm check"Notes
Manual notes are optional, but useful when you want to force a specific memory item.
aictx note "Use Transformers.js as default embedding provider" --type decision
aictx note "Fix stale vector detection next" --type next-step
aictx note "Vitest failed because vectors were not normalized" --type errorObsidian Mirror
Obsidian support is optional.
SQLite, timeline, and indexes remain the source of truth.
Initialize Obsidian mirror:
aictx obsidian initSync memory to Obsidian:
aictx obsidian syncUse Obsidian when you want human-readable project memory.
Optional MCP Server
Start MCP server:
aictx mcp startShow MCP help:
aictx mcp --helpMCP is an optional access layer. It does not replace the CLI.
Privacy
AICTX is local-first.
Memory is stored in your project under .aictx/
No cloud API is required by default
No hidden AI thought process is captured
Visible transcripts can be imported/watched
Command output can be captured when you choose to use aictx run
Secrets are redacted before storage/outputDo not commit .aictx/ unless you intentionally want to share project memory.
Recommended .gitignore entry:
.aictx/Files Created
Typical AICTX project memory:
.aictx/
state.sqlite
timeline.jsonl
current-session.json
config.json
indexes/
snapshots/
checkpoints/
handoffs/
embeddings/
inbox/Common Commands
aictx --help
aictx --version
aictx init
aictx status
aictx doctor
aictx start "Build feature"
aictx watch
aictx timeline
aictx note "Use SQLite as source of truth" --type decision
aictx checkpoint --title "Parser working"
aictx run -- pnpm test
aictx run -- pnpm build
aictx transcript import ./chat.md
aictx transcript watch
aictx transcript extract
aictx workflow status
aictx workflow mode transcript
aictx workflow mode shell
aictx symbols
aictx embed
aictx embeddings status
aictx search "auth refresh"
aictx search "login session bug" --semantic
aictx get decision.sqlite-source-of-truth
aictx handoff --compact
aictx pack
aictx obsidian init
aictx obsidian sync
aictx mcp startDevelopment
Clone the repo:
git clone <repo-url>
cd aictxInstall dependencies:
pnpm installRun in development:
pnpm dev -- --helpRun a command through dev mode:
pnpm dev -- run -- echo helloBuild:
pnpm buildRun tests:
pnpm testRun full check:
pnpm checkLocal Publish Smoke Test
Before publishing to npm:
pnpm check
pnpm build
npm packInstall packed tarball globally:
npm install -g ./aicontext-cli-*.tgzTest:
aictx --help
aictx --versionPublishing
Dry run:
npm publish --dry-runPublish:
npm publishAfter publish, install from npm:
npm install -g aicontext-cliThen verify:
aictx --help
aictx --versionTroubleshooting
zsh: command not found: aictx
Install globally:
npm install -g aicontext-cliOr test locally:
npm linkCheck npm global prefix:
npm prefix -gPermission denied
Make sure built CLI has a shebang:
head -n 1 dist/index.jsExpected:
#!/usr/bin/env nodeMake executable:
chmod +x dist/index.jsaictx run does not pass flags
Use --:
aictx run -- vitest --runNot:
aictx run vitest --runVersion already exists on npm
Bump version:
npm version patch
npm publishPackage Name vs Command Name
The npm package is installed as:
npm install -g aicontext-cliBut the command is still:
aictxThis works because package.json should include:
{
"name": "aicontext-cli",
"bin": {
"aictx": "dist/index.js"
}
}What AICTX Does Not Do
AICTX does not:
capture hidden AI chain-of-thought
replace Git
replace your test suite
require Obsidian
require MCP
require cloud APIs
guarantee perfect semantic search
automatically know terminal commands unless run through aictx run or supported shell captureRecommended First Commands
aictx init
aictx start "My current development task"
aictx transcript watchIn another terminal:
aictx watchRun tests through AICTX:
aictx run -- pnpm testGenerate handoff:
aictx handoff --compactLicense
MIT License
Copyright (c) 2026 Dharsan Guruparan
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
