turbostash
v0.1.0
Published
CLI tool for Turbostash remote cache service
Readme
Turbostash CLI
Command-line interface for Turbostash remote cache service, compatible with Turborepo Remote Cache API (V8).
Installation
Global Installation
npm install -g turbostashAfter installation, you can use the turbostash command from anywhere:
turbostash --helpLocal Installation
npm install turbostashThen use via npx:
npx turbostash --helpCommands
turbostash init
Initialize Turbostash in the current project.
turbostash initturbostash auth
Authenticate with Turbostash (login).
turbostash authturbostash logout
Log out from Turbostash.
turbostash logoutturbostash whoami
Display current user and team information.
turbostash whoamiturbostash tokens
Manage API tokens.
List tokens
turbostash tokens listCreate a new token
turbostash tokens createRevoke a token
turbostash tokens revoke <token-id>turbostash config
Show current configuration.
turbostash configturbostash link
Link current directory to a team.
turbostash linkturbostash env
Configure environment variables.
turbostash envLocal Development
Prerequisites
- Node.js 18+
- pnpm (recommended) or npm
Setup
- Clone the repository:
git clone <repository-url>
cd turbostash- Install dependencies:
pnpm install- Build the CLI:
cd apps/cli
pnpm buildTesting Locally
Using npm link
- From the
apps/clidirectory, create a global link:
npm link- Now you can use
turbostashfrom anywhere:
turbostash --help- To unlink:
npm unlink -g turbostashUsing pnpm link
- From the
apps/clidirectory:
pnpm link --global- Use
turbostashfrom anywhere:
turbostash --help- To unlink:
pnpm unlink --global turbostashRunning Tests
# Run all tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run tests with coverage
pnpm test:coverageDevelopment Workflow
- Make changes to source files in
src/ - Build the project:
pnpm build- Test your changes:
# Using npm link (if linked)
turbostash init
# Or directly with node
node dist/index.js initPublishing
Prerequisites
- npm account with access to publish
turbostashpackage - Authenticated with npm:
npm login
Build Process
The package uses TypeScript and must be compiled before publishing:
pnpm buildThis compiles TypeScript files from src/ to dist/.
Version Bumping
Update the version in package.json following Semantic Versioning:
- Patch (0.1.0 → 0.1.1): Bug fixes
- Minor (0.1.0 → 0.1.0): New features, backward compatible
- Major (0.1.0 → 1.0.0): Breaking changes
You can use npm version commands:
npm version patch # 0.1.0 → 0.1.1
npm version minor # 0.1.0 → 0.2.0
npm version major # 0.1.0 → 1.0.0This automatically updates package.json and creates a git tag.
Publishing Steps
- Ensure you're in the correct directory:
cd apps/cli- Build the package:
pnpm build- Verify the build output:
ls -la dist/You should see compiled JavaScript files.
- Test the binary locally:
node dist/index.js --help- Check what will be published:
npm pack --dry-runThis shows what files will be included in the package.
- Publish to npm:
npm publishFor scoped packages or first-time publishing, you might need:
npm publish --access publicPublishing Checklist
- [ ] All tests pass (
pnpm test) - [ ] TypeScript compiles without errors (
pnpm build) - [ ] Version updated in
package.json - [ ] Build output verified (
ls dist/) - [ ] Binary tested locally (
node dist/index.js --help) - [ ]
npm pack --dry-runshows expected files - [ ] Git changes committed (if using
npm version) - [ ] Ready to publish
Post-Publishing
After publishing:
- Verify installation:
npm install -g turbostash
turbostash --version- Test the published package:
turbostash init- Update documentation if needed
Project Structure
apps/cli/
├── src/
│ ├── index.ts # Main CLI entry point
│ ├── commands/ # Command implementations
│ │ ├── init.ts
│ │ ├── auth.ts
│ │ ├── logout.ts
│ │ ├── whoami.ts
│ │ ├── tokens.ts
│ │ ├── config.ts
│ │ ├── link.ts
│ │ └── env.ts
│ └── utils/
│ └── output.ts # Shared utilities
├── tests/ # Test files
│ ├── commands/
│ └── helpers.ts
├── dist/ # Compiled output (generated)
├── package.json
├── tsconfig.json
└── README.mdRequirements
- Node.js 18.0.0 or higher
License
MIT
