We use pnpm for package management. Please make sure pnpm is installed.
The CLI is currently built by bundling the extension core and replacing the vscode rendering parts with a cli rendering engine. To develop on the CLI you need to follow a few steps:
Install dependencies from the root workspace folder:
pnpm install
Set up your environment file. Copy the sample and configure your API keys:
cp .env.sample cli/dist/.env
# Edit cli/dist/.env with your API keys
Build the extension core from the root workspace folder:
pnpm cli:bundle
Change into the cli folder:
cd ./cli
Build & run the extension by running pnpm start:dev. If you want to use the CLI to work on its own code, you can run pnpm start:dev -w ../ which will start it within the root workspace folder.
While not required, it's pretty helpful to view log output of the cli in a separate terminal while you're developing. To do this, open a new terminal window and run pnpm logs. You can also run pnpm logs:clear to truncate any on-disk logs during development.
If you just want to quickly test your changes without the dev server, you can run the bundled CLI directly:
# From the root workspace folder
pnpm install && pnpm cli:bundle
node cli/dist/index.js
pnpm test will test the cli specific code, though many changes require changing the extension code itself, which is tested from the root workspace folder. We also have pnpm check-types and pnpm lint for doing type-checking and linting of the CLI specific code.
Changeset version bump PR to make sure that all changes are included in the CHANGELOG.Build CLI Package job to finish building on main..tgz file inside of it.npm install -g ./kilocode-cli-1.1.1.tgz.kilocode project.npm publish to publish the version after testing is complete.