This guide covers installing and setting up Track CLI on your system.
Track CLI requires:
- Node.js >= 18.0.0
- npm (comes with Node.js)
node --version # Should show v18.0.0 or higher
npm --version # Should show 8.0.0 or higherIf you need to install or update Node.js:
- Download from nodejs.org
- Or use a version manager like nvm
This is the current installation method while Track CLI is not yet published to npm.
git clone <repository-url>
cd track-clinpm installnpm run buildThis compiles TypeScript source files from src/ to JavaScript in dist/.
npm linkThis makes the track command available globally in your terminal.
Alternative: Run directly without linking:
node ./dist/index.js <command>If you prefer not to link globally, you can use Track CLI within a specific project:
# Clone and build as above
npm install
npm run build
# Add to your project's package.json scripts
{
"scripts": {
"track": "node ../track-cli/dist/index.js"
}
}
# Use via npm
npm run track -- init "My Project"After installation, verify Track CLI works correctly:
track --version
# Should output: 0.1.0
track --help
# Should show available commandsTrack CLI stores project data in a .track/ directory within your project:
your-project/
├── .track/
│ └── track.db # SQLite database
├── src/
└── ...
If you're using git, you may want to add .track/ to your .gitignore:
echo ".track/" >> .gitignoreWhen to track .track/:
- ✅ Single developer working alone
- ✅ Want to share project state with team
When NOT to track .track/:
- ✅ Multiple developers with independent work (recommended)
- ✅ Want clean diffs without database changes
- ✅ Using Track CLI for personal session notes
For active development on Track CLI itself:
npm run devThis watches for TypeScript changes and rebuilds automatically.
For a clean production build:
# Clean previous build
rm -rf dist/
# Build
npm run buildTo update to the latest version:
cd track-cli
git pull
npm install # Update dependencies if needed
npm run buildIf you've globally linked Track CLI, the track command will automatically use the updated version.
Cause: Track CLI isn't globally linked or not in your PATH.
Solutions:
- Run
npm linkin the track-cli directory - Or use the full path:
node /path/to/track-cli/dist/index.js - Or add an alias:
alias track="node /path/to/track-cli/dist/index.js"
Cause: Dependencies not installed or TypeScript not compiled.
Solution:
npm install
npm run buildCause: Missing build tools for native modules.
Solutions:
macOS:
xcode-select --installUbuntu/Debian:
sudo apt-get install build-essential python3Windows:
npm install --global windows-build-toolsCause: Another process has the database open.
Solutions:
- Close any other Track CLI commands
- Check for stuck processes:
ps aux | grep track - If needed, delete
.track/track.db-shmand.track/track.db-wal(only if no commands running)
Cause: Incompatible TypeScript version or corrupted node_modules.
Solution:
rm -rf node_modules package-lock.json
npm install
npm run buildTo remove Track CLI:
# If globally linked
npm unlink -g track-cli
# Remove the repository
rm -rf /path/to/track-cliTo remove Track CLI data from a project:
rm -rf .track/Now that Track CLI is installed:
- Read the Usage Guide for tutorials and workflows
- Check the Command Reference for quick lookups
- See Examples for real-world usage patterns
Or jump right in:
track init "My First Project"
track new "My First Feature"
track status