{"_id":"@affectively/dash-cli","_rev":"3-526e8ad27705a0d5b7a3c7a7a1136e19","name":"@affectively/dash-cli","dist-tags":{"latest":"5.0.0"},"versions":{"0.2.0":{"name":"@affectively/dash-cli","version":"0.2.0","keywords":["dash","cli","sqlite","local-first","database","jq","query"],"author":{"name":"Affectively"},"license":"MIT","_id":"@affectively/dash-cli@0.2.0","maintainers":[{"name":"buley","email":"buley@outlook.com"}],"bin":{"dash":"bin/dash.js"},"dist":{"shasum":"00aa33ba799ee5b24a438d1bf3ec012e753f3d33","tarball":"https://registry.npmjs.org/@affectively/dash-cli/-/dash-cli-0.2.0.tgz","fileCount":5,"integrity":"sha512-0EolLbGB1lKT09NlYL0cfrLUj6X7ojQh9KrOfyjzaLG2Jry8ggyxhzFzyB3KxU9xq3ckNys62/b7gpoPq4WZhA==","signatures":[{"sig":"MEQCIGnNYNbjmPKPgriaHBQ6dMkKtjzsmydhq03HPsJSa9p+AiAwBvLykT/forLvYV2ljgeNX9L51YHiV0g7fK5xwoxLUQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1962355},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"1d332ea99d76d250fa824a6dc08e3e4b26c20832","scripts":{"dev":"bun run ./bin/dash.ts","test":"bun test","build":"bun build ./src/index.ts --outdir ./dist --target bun && bun build ./bin/dash.ts --outfile ./bin/dash.js --target bun","pack:verify":"NPM_CONFIG_CACHE=./.npm-cache bun run build && NPM_CONFIG_CACHE=./.npm-cache npm pack --dry-run"},"_npmUser":{"name":"buley","email":"buley@outlook.com"},"_npmVersion":"11.8.0","description":"Dash CLI - The sovereign, local-first database for your command line","directories":{},"_nodeVersion":"25.5.0","dependencies":{"yjs":"^13.6.0","zod":"^3.23.8","y-websocket":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.17.0","bun-types":"latest","typescript":"^5.3.3","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/dash-cli_0.2.0_1770830121471_0.4221992385375959","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package is deprecated and no longer supported. Do not use."},"5.0.0":{"name":"@affectively/dash-cli","version":"5.0.0","keywords":["dash","cli","sqlite","local-first","database","jq","query"],"author":{"url":"https://buley.fyi","name":"Taylor William Buley"},"license":"UNLICENSED","_id":"@affectively/dash-cli@5.0.0","maintainers":[{"name":"buley","email":"buley@outlook.com"}],"bin":{"dash":"bin/dash.js"},"dist":{"shasum":"daf220fe4fd4b15e7ae47fdc0e3359f66352fa41","tarball":"https://registry.npmjs.org/@affectively/dash-cli/-/dash-cli-5.0.0.tgz","fileCount":5,"integrity":"sha512-8/ELcvE/brnwRctL2CZf4KGYrHAu612EnPvgUd9KC9+3+RPdCJSE/LMd7yJUc3FDZWzxyPdl/EDzvd8v+PBTag==","signatures":[{"sig":"MEUCIEH/tHcXt54M4pt12gmReiYLR9YIZK+C7nCKEdcw5iXNAiEAhdMgbgAA/2JMS9leZohjg1Ppy4bfs6m1m9lCQ3rHlxE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1032933},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"ae54b0df6ac98ed86b037accafa16cf218dda541","scripts":{"dev":"bun run ./bin/dash.ts","test":"bun test","build":"bun build ./src/index.ts --outdir ./dist --target bun && bun build ./bin/dash.ts --outfile ./bin/dash.js --target bun","pack:verify":"NPM_CONFIG_CACHE=./.npm-cache bun run build && NPM_CONFIG_CACHE=./.npm-cache npm pack --dry-run"},"_npmUser":{"name":"buley","email":"buley@outlook.com"},"_npmVersion":"11.8.0","description":"Dash CLI - The sovereign, local-first database for your command line","directories":{},"_nodeVersion":"25.5.0","dependencies":{"yjs":"^13.6.0","zod":"^3.23.8","y-websocket":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.17.0","bun-types":"latest","typescript":"^5.3.3","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/dash-cli_5.0.0_1773156227688_0.6475708908855877","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package is deprecated and no longer supported. Do not use."}},"time":{"created":"2026-02-11T17:15:21.403Z","modified":"2026-03-27T20:03:25.937Z","0.2.0":"2026-02-11T17:15:21.693Z","5.0.0":"2026-03-10T15:23:47.929Z"},"author":{"url":"https://buley.fyi","name":"Taylor William Buley"},"license":"UNLICENSED","keywords":["dash","cli","sqlite","local-first","database","jq","query"],"description":"Dash CLI - The sovereign, local-first database for your command line","maintainers":[{"name":"buley","email":"buley@outlook.com"}],"readme":"# Dash CLI\n\n**The Sovereign Database for Your Command Line**\n\nYour data. Your device. Your rules. No cloud required.\n\n## Installation\n\n```bash\n# From npm (coming soon)\nnpm install -g @affectively/dash-cli\n\n# Or run directly with bun\nbun run bin/dash.ts\n```\n\n## Quick Start\n\n```bash\n# Initialize a new Dash database\ndash init\n\n# Create a table and insert data\ndash query \"CREATE TABLE notes (id TEXT PRIMARY KEY, content TEXT, created_at INTEGER)\"\ndash query \"INSERT INTO notes VALUES ('1', 'My first note', 1707321600000)\"\n\n# Query with SQL\ndash query \"SELECT * FROM notes\"\n\n# Pipe to JQ transformations\ndash query \"SELECT * FROM notes\" | dash jq '.[].content'\n```\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `dash init` | Initialize a new Dash database in `.dash/` |\n| `dash query <sql>` | Execute a SQL query |\n| `dash search <text>` | Semantic vector search |\n| `dash sync` | Sync with configured remotes (Relay, D1) |\n| `dash export` | Export database to various formats |\n| `dash import` | Import from external sources |\n| `dash jq <expr>` | JQ-style JSON transformation |\n| `dash status` | Show database and sync status |\n| `dash bench` | Run performance benchmarks |\n| `dash help` | Show help message |\n\n## Benchmarking\n\nDash includes built-in benchmarking that stores results in the local database - Dash measuring Dash.\n\n### Running Benchmarks\n\n```bash\n# Run with default 1000 iterations\ndash bench\n\n# Run with custom iterations\ndash bench --iterations=5000\n\n# Compare with previous runs\ndash bench --compare\n\n# View benchmark history\ndash bench --history\n```\n\n### Benchmark Results\n\nPerformance on Apple Silicon (M-series), Bun 1.3.5+:\n\n| Operation | Ops/Sec | Avg Latency | Min Latency | Max Latency |\n|-----------|---------|-------------|-------------|-------------|\n| **SELECT by ID** | 117,222 | 0.0085 ms | 0.0040 ms | 0.1250 ms |\n| **JSON.parse** | 46,109 | 0.0217 ms | 0.0080 ms | 0.0830 ms |\n| **INSERT** | 3,446 | 0.2902 ms | 0.1250 ms | 0.5830 ms |\n| **UPDATE** | 3,372 | 0.2966 ms | 0.1250 ms | 0.6250 ms |\n| **DELETE** | 3,050 | 0.3279 ms | 0.1670 ms | 0.6670 ms |\n\n**Key Insights:**\n- Read operations (SELECT) are **34x faster** than writes\n- Bun's native SQLite achieves enterprise-grade performance\n- Sub-millisecond latency for all operations\n- Write operations bottlenecked by SQLite's WAL/fsync (expected)\n\n### Viewing Stored Results\n\nBenchmark results are stored in the `dash_benchmarks` table:\n\n```bash\n# View all benchmark history\ndash query \"SELECT name, ops_per_sec, avg_latency_ms, created_at FROM dash_benchmarks ORDER BY created_at DESC\"\n\n# View by operation type\ndash query \"SELECT * FROM dash_benchmarks WHERE operation = 'select' ORDER BY created_at DESC LIMIT 5\"\n\n# Extract just ops/sec with jq\ndash query \"SELECT * FROM dash_benchmarks\" | dash jq '.[] | {name: .name, ops: .ops_per_sec}'\n```\n\n## Sync\n\n### One-Time Sync\n\n```bash\n# Sync specific tables with a relay\ndash sync --relay=wss://relay.example.com --tables=notes,users\n```\n\n### Seed Mode (Persistent Peer)\n\nRun the CLI as a persistent sync peer for other devices:\n\n```bash\n# Run as seed peer (keeps running)\ndash sync --relay=wss://relay.example.com --seed --tables=notes\n```\n\nThis enables:\n- Desktop CLI seeding mobile devices\n- Server instances providing always-on sync\n- Peer-to-peer sync without central servers\n\n### Configuration\n\nConfigure sync in `.dash/config.json`:\n\n```json\n{\n  \"sync\": {\n    \"relay\": \"wss://relay.example.com\",\n    \"d1\": \"https://api.example.com/sync\"\n  }\n}\n```\n\n## JQ Transformations\n\nPipe query output through JQ-style transformations:\n\n```bash\n# Extract specific fields\ndash query \"SELECT * FROM users\" | dash jq '.[].name'\n\n# Filter and transform\ndash query \"SELECT * FROM scores\" | dash jq '.[] | select(.score > 80)'\n\n# Aggregate\ndash query \"SELECT * FROM numbers\" | dash jq '[.[] | .value] | add'\n\n# Sort\ndash query \"SELECT * FROM items\" | dash jq 'sort_by(.created_at)'\n```\n\n### Supported JQ Operations\n\n- **Path access**: `.field`, `.field.subfield`, `.[0]`, `.[]`\n- **Functions**: `length`, `keys`, `values`, `type`, `sort`, `sort_by()`, `reverse`, `unique`, `flatten`, `first`, `last`, `min`, `max`, `add`\n- **Filtering**: `select(condition)`, `map(expr)`\n- **Conditionals**: `if-then-else`\n- **Pipes**: `expr | expr | expr`\n\n## Export & Import\n\n### Export\n\n```bash\n# Export to JSON file\ndash export --to=json --file=backup.json\n\n# Export to stdout\ndash export --to=json\n```\n\n### Import\n\n```bash\n# Import from JSON\ndash import --from=json --file=data.json\n\n# Firebase (export first, then import)\ndash import --from=firebase --project=my-app\n\n# Notion\ndash import --from=notion --token=secret_xxx\n```\n\n## Database Location\n\nBy default, Dash stores data in `.dash/` in the current directory.\n\n```bash\n# Change location with environment variable\nDASH_DIR=/path/to/custom dash init\n```\n\n## Schema\n\nCore tables created by `dash init`:\n\n| Table | Purpose |\n|-------|---------|\n| `dash_meta` | Database metadata (version, config) |\n| `dash_sync_queue` | Pending sync operations |\n| `dash_vectors` | Vector embeddings for semantic search |\n| `dash_yjs_state` | CRDT state for sync |\n| `dash_benchmarks` | Performance benchmark history |\n| `dash_ucans` | UCAN authentication tokens |\n\n## The Pirate's Creed\n\n```\nWe don't ask permission to own our data.\nWe don't pay rent to access our memories.\nWe don't need their servers to collaborate.\n\nYour data. Your device. Your rules.\n```\n\n## License\n\nMIT - Use freely, own your data.\n\n## Links\n\n- [Dash Core (Browser)](https://github.com/affectively-ai/dash)\n- [Affectively](https://affectively.ai)\n","readmeFilename":"README.md"}