All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
UX Polish — in-house syntax highlighter, enhanced diff renderer, history search/filter/export, and structured --format json/ndjson/plain output across all data-producing commands.
Diff Renderer (src/ui/diff-renderer.ts)
renderDiff(diffText, options: DiffRenderOptions): string— enhanced diff renderer with syntax highlighting, line numbers, collapsible unchanged sections, and optional side-by-side layoutDiffRenderOptionsinterface:split,lineNumbers,collapseThreshold,language?,terminalWidth?- Unchanged context runs exceeding
collapseThresholdare collapsed to... N unchanged lines ... - File header line above each file's diff showing path and
+M -N linesmutation summary - Side-by-side rendering when
--splitis passed and terminal width > 120 columns; falls back to unified silently otherwise
In-House Syntax Highlighter (src/ui/highlight.ts)
highlight(code, options): string— zero-dependency syntax highlighter usingpicocolors(already a project dependency)inferLanguageFromPath(filePath): SupportedLanguage | null— maps file extensions to language identifiers- Supported languages: TypeScript/JavaScript (keywords, strings, comments, numbers, type annotations), Prisma (model/enum/directive keywords), JSON (keys, values, booleans, null), Markdown (headings, bold/italic, inline code, fenced blocks)
- Returns input unchanged for unsupported languages — never throws
History Queries (src/storage/queries.ts)
searchSessions(db, query, options?)— case-insensitive full-text search across sessioncommand,project_root, and messagecontent; results ordered by relevance (message matches ranked above metadata matches)filterSessions(db, filters)— filter sessions bycommand,since,status, andlimitwith AND logicexportSessionMarkdown(db, sessionId, outputPath)— write a markdown transcript with session metadata table, chronological message transcript, and tool execution table; creates parent directories automaticallyparseSinceExpression(expr): Date— parses"N days/hours/minutes ago"and ISO 8601 date strings; throws with descriptive message for unrecognized formats
History Command Enhancements
aria history search "<query>"— full-text search subcommand with relevance-ranked resultsaria history --command <cmd>— filter by command namearia history --since "<expr>"— filter by date (natural language or ISO 8601)aria history --status <status>— filter by session status (running,completed,failed,cancelled)aria history --session <id> --export <path>— export session as markdown file--treenow shows tool-type icons:[R]read,[S]search,[W]mutation,[.]other;✓green for success,✗red for error
Structured Output (src/output/schemas.ts)
OutputVersion = '1'— versioned output type for downstream stability- Zod schemas for all 11 commands:
AskOutputSchema,PlanOutputSchema,PatchOutputSchema,ReviewOutputSchema,ExploreOutputSchema,DbSchemaOutputSchema,DbAskOutputSchema,DbExplainOutputSchema,HistoryOutputSchema,DoctorOutputSchema,UpgradeDepsOutputSchema formatOutput<T>(data, format, schema): string— validates data against schema before serializing; throwsOutputValidationErroron validation failureOutputValidationErrorclass withissues: ZodIssue[]field
--format Flag Expansion
- All data-producing commands now accept
--format json,--format ndjson, and--format plain json— single validated JSON object to stdout, all spinner/info output suppressedndjson— one JSON object per line; final{"version":"1","event":"done"}line on success;{"version":"1","event":"error","error":"..."}to stderr on failureplain— tab-separated output with no ANSI codes and nocli-table3box-drawing characters- Structured error output:
--format jsonfailures write{"version":"1","error":"...","exitCode":N}to stderr; stdout remains empty
aria patch Enhancements
--splitflag — enable side-by-side diff rendering (requires terminal width > 120)--format plain— disables line numbers and ANSI codes in diff output; requires--yes(exits with code 2 otherwise)- Default diff rendering now uses
renderDifffromsrc/ui/diff-renderer.tswithlineNumbers: trueandcollapseThreshold: 5
- Bumped version to
0.2.3 --formattype widened from'text' | 'json'to'text' | 'json' | 'ndjson' | 'plain'validateArgsrejects any--formatvalue not in['text', 'json', 'ndjson', 'plain']with exit code 2validateArgsrejects any--statusvalue not in['running', 'completed', 'failed', 'cancelled']with exit code 2aria patchdiff preview uses the new enhanced renderer by default (line numbers on, collapse threshold 5)
Provider Expansion — global --provider and --model flags, per-provider config overrides, and full provider support across all commands including db and upgrade.
Global CLI Flags
--provider <name>— override the default provider for a single command (anthropic,openai,ollama,openrouter)--model <name>— override the LLM model for a single command (e.g.deepseek/deepseek-chat,gpt-4o)--prisma-model <name>— filter to a specific Prisma model indbcommands (replaces the previous--modelflag indbcontext)
Per-Provider Configuration
[provider.anthropic]section in TOML config with optionalmodeloverride[provider.openrouter]section in TOML config with optionalmodelandbaseUrloverridesOPENROUTER_BASE_URLenvironment variable for custom OpenRouter-compatible endpoints
Provider Support in All Commands
aria db ask,aria db explain,aria db migratenow accept--providerand--modelaria upgrade deps,aria upgrade prismanow accept--providerand--model
Doctor Improvements
- Provider check now shows the active model name
- Secondary providers with configured API keys are reported as available
Tests
- CLI parser tests for
--provider,--model,--prisma-modelflags and their=syntax variants - Config tests for per-provider overrides,
--providerflag validation, andbaseUrlfrom TOML
--modelis now a global flag for LLM model selection; use--prisma-modelfor Prisma model filtering indbcommands- Invalid
--providervalue now throwsConfigErrorwith a clear message listing valid providers (was silently ignored) - CLI
--modelflag takes precedence over per-provider model overrides from config files OPENROUTER_BASE_URLis validated as a URL before being passed to config (invalid URL throwsConfigError)- Doctor no longer warns about unconfigured secondary providers — only reports providers with keys present
OpenRouterProvideraccepts a configurablebaseUrlvia constructor, config, or environment variable- Default OpenRouter model aligned to
anthropic/claude-sonnet-4-6(wasanthropic/claude-sonnet-4) - Help text for
--providernow lists all four valid providers
aria db ask --provider openrouterwas silently ignored — provider/model flags now forwarded to alldbandupgradesub-actions--modelindbcommands no longer collides with the global LLM model flag — Prisma model filtering moved to--prisma-modelprisma-upgrade.tsfetchLatestVersion— removedas anycast, narrowed npm registry response to proper type guardresolveModel()precedence: CLI--modelnow correctly overrides per-provider model from config files
Upgrade Automation — AI-assisted dependency and framework upgrades with preview and safety gates.
Commands
aria upgrade deps— analyze outdated dependencies, classify by semver risk (patch/minor/major), propose grouped upgrades topackage.jsonwith preview and confirmationaria upgrade prisma— Prisma-specific upgrade with version detection, migration guidance for major upgrades, and step-by-step next actions
Modules
src/upgrade/outdated.ts— wrapsnpm/pnpm/yarn/bun outdated --jsonvia subprocess, normalizes output across all package managerssrc/upgrade/classifier.ts— semver-based risk classification (patch/minor/major/prerelease) usingsemver.diff()src/upgrade/changelog.ts— fetches repository URLs from npm registry for release notes links; parallel HTTP requestssrc/upgrade/prisma-upgrade.ts— detects current Prisma version frompackage.json, fetches latest from npm registry with subprocess fallback
Flags
--risk <patch|minor|major|all>— filter upgrades by risk level (default:minorincludes patch + minor)--dev— include devDependencies in upgrade scope
Prompts
src/prompts/upgrade_deps.md— system prompt for LLM-assisted major upgrade analysissrc/prompts/upgrade_prisma.md— system prompt for Prisma-specific migration guidance
Safety
- Aria never runs
npm install,pnpm install,yarn install, orbun install— only modifiespackage.jsonand prints the install command for the user - Aria never runs
prisma migrate— prints manual migration steps - Property tests 21 (no install commands) and 22 (no prisma migrate) enforce this statically
Tests
tests/unit/classifier.test.ts— semver classification edge cases + Property 20 (classification correctness via fast-check)tests/unit/outdated.test.ts— npm/pnpm/yarn output parsing with mocked subprocesstests/unit/upgrade-safety.test.ts— Properties 21 and 22 (static source scan for forbidden subprocess calls)- CLI parser tests for
upgradesubcommand,--risk, and--devflags
- Bumped version to
0.2.1 - Added
semver(^7.6.0) to dependencies,@types/semver(^7.5.0) to devDependencies
- Removed duplicate
OllamaProvider.prototype.chatoverride inprovider.ts(dead code — identical to class method) - Added message array trimming in
agent.tsto prevent unbounded memory growth during long sessions - Parallelized HTTP requests in
changelog.ts(was sequential, nowPromise.all) - Added response body drain on HTTP errors in
prisma-upgrade.tsandchangelog.tsto free TCP connections - Removed unused function parameters in
upgrade-deps.tsandupgrade-prisma.ts - Fixed double session initialization in upgrade actions (was silently swallowing SQLite duplicate key errors)
- Optimized
classifyUpgradeinclassifier.ts— reduced from 5 semver calls to 2
Prisma DB Assistant — schema-aware database tooling for Prisma projects. No database connections, no query execution — all value comes from deep understanding of schema.prisma and static analysis of Prisma Client usage in code.
Commands
aria db schema— parse and renderschema.prismacontent (models, fields, relations, enums, indexes); supports--jsonand--model <name>filtering; no LLM call — instant and freearia db ask <question>— Q&A over Prisma schema with Prisma Client code generation; warns on sensitive field access (password, token, secret, apiKey)aria db explain <description>— analyze Prisma Client usage in code, identify N+1 queries, missing indexes, over-fetching; suggests@@indexadditions and query improvementsaria db migrate <description>— propose changes toschema.prismawith diff preview and confirmation; prints manualprisma migratecommands for user to run; never executes migrations
Modules
src/db/schema.ts— Prisma schema parser wrapping@mrleebo/prisma-ast; extracts models, fields, relations, enums, indexes, generators, datasource providersrc/db/summary.ts— human-readable terminal rendering of parsed schema with color-coded tablessrc/db/client-usage.ts— ripgrep-based Prisma Client usage finder (prisma.model.operationpatterns)src/db/migrate.ts— schema change proposal helpers, manual migration instruction generator
Tools
read_prisma_schema_parsed— returns structuredPrismaSchemaInfofor the project's schemafind_prisma_usage— searches for Prisma Client calls in TS/JS files with model/operation filteringfind_model_references— finds all references to a Prisma model name across the codebasepropose_schema_change— validates new schema content, generates diff, stores for confirmationapply_schema_change— applies a previously proposed schema change atomically
Prompts
src/prompts/db_ask.md— system prompt for schema Q&A and Prisma Client code generationsrc/prompts/db_explain.md— system prompt for query analysis and performance optimizationsrc/prompts/db_migrate.md— system prompt for schema migration proposals
Doctor
aria doctornow reports Prisma schema presence, provider, and model count
Tests
- Fixture projects:
prisma-simple,prisma-ecommerce,prisma-auth,prisma-relations tests/db/schema.test.ts— parser tests across all fixturestests/db/summary.test.ts— rendering teststests/db/client-usage.test.ts— Prisma Client usage finder tests
- Bumped version to
0.2.0 - Added
@mrleebo/prisma-ast(^0.15.0) to dependencies - Updated CLI parser to support
dbsubcommand group withschema,ask,explain,migratesubcommands - Updated
aria --helpto listdbcommand
Initial release of Aria Code CLI.
Commands
aria ask— read-only Q&A over the repository using read-only toolsaria plan— generate structured implementation plans without making changes; supports--outputto save as markdownaria patch— propose and apply unified diffs atomically with preview, confirmation, and rollback hints; supports--dry-runand--yesaria review— AI-assisted review of staged git changes; supports--unstaged,--branch, and--format jsonaria explore— scan repository structure, detect frameworks and entry points, summarize architectural patterns; supports--savearia history— inspect past sessions from the local SQLite database; supports--session,--limit, and--treearia config— view and manage configuration withget,set,path, andinitsubcommandsaria doctor— run environment diagnostics covering Node.js version, git, ripgrep, config validity, history DB, and provider readiness
Provider Support
- Anthropic (
claude-sonnet-4-6default) - OpenAI
- Ollama (local models)
- OpenRouter
- Exponential backoff retry logic for all provider API calls
- Configurable request timeout
Configuration
- TOML configuration files at
~/.aria/config.toml(user) and./.aria.toml(project) - Configuration precedence: CLI flags > environment variables > project config > user config > defaults
- Full schema validation with descriptive error messages
- Environment variable overrides for all major settings
Safety
- Project root boundary enforcement — all file operations validated against project root
- Path traversal and symlink escape prevention
- Shell command allowlist enforcement
.envandnode_modulesexcluded from directory listings by default- API keys never logged to history or terminal output
- History database stored with
600permissions (user-only)
Session History
- SQLite database at
~/.aria/history.dbwith versioned schema migrations - Sessions, messages, tool executions, and mutations all persisted
- Session lifecycle tracking:
running→completed/failed/cancelled - Configurable retention policy (default: 90 days)
- Session resumption via
--sessionflag foraskandplan
Terminal UI
- Color output via
picocolorswith auto-detection of TTY support - Diff rendering with syntax highlighting
- Tabular output via
cli-table3for history and config commands - Interactive confirmation prompts via
prompts - Progress indicators for long-running operations
--quietflag to suppress non-essential output
Project Detection
- Automatic detection of Next.js (app router and pages router), Nest.js, and Node.js projects
- Prisma detection from dependencies and schema file
- Package manager detection from lockfile presence (npm, pnpm, yarn, bun)
Error Handling
- Consistent exit codes: 0 success, 1 generic, 2 invalid args, 3 config, 4 provider, 5 project detection, 130 cancelled
- Stack traces shown only when
DEBUG=1is set - All error messages written to stderr