CLI npm Release Check
This page is the last check before the CLI goes to npm. It proves the package works like a real user would use it.
What we check
We check the box. Then we check the tool inside the box.
The box is the npm package. It should only hold what users need. That means the built CLI, the readme, and the package file.
The tool is the CLI itself. We install it in a new folder. Then we use it with a real login.
The package
Run the normal checks. They should pass.
pnpm --filter @redopage/cli run typecheck
pnpm --filter @redopage/cli run test
pnpm --filter @redopage/cli run build Then do an npm dry run. This does not publish. It shows what would ship.
cd redo-cli
npm publish --dry-run --access public The package should include these files.
README.md
dist/index.js
package.json The scratch folder
Do not test from the repo. Make a fresh folder. This is a clean room.
mkdir -p /Users/andrew/dev/research/redo-cli-npm-smoke
cd /Users/andrew/dev/research/redo-cli-npm-smoke Install the packed CLI there. Then check both command names.
npm init -y
npm install /path/to/redopage-cli-*.tgz
./node_modules/.bin/redo --version
./node_modules/.bin/cms --version After the package is live on npm, test the npm install too.
npm install @redopage/cli
./node_modules/.bin/redo --version
./node_modules/.bin/cms --version The login
Run login from the scratch folder. The browser shows a code page. Approve it with a test org.
./node_modules/.bin/redo login --local --no-browser --no-interactive After approval, the scratch folder has its own .redo/config.json. That is good. It
means the test is not using repo state by accident.
The smoke test
Use a test site. The CLI should be able to see pages, pull files, push files, upload media, and run AI.
redo site list --local
redo use <site-id>
redo list pages --local
redo read page 1 --local
redo pull page 1 --local
redo dev --build Now test a real edit. Make a throwaway page. Pull it. Edit its block file. Push it back. Then read the block to prove the text came back.
redo create page /cli-smoke "CLI Smoke" --local
redo update '/page/<page-id>/title = "CLI Smoke Updated"' --local
redo pull page <page-id> --local
redo push page <page-id> --local
redo read block <block-id> --local Test media. Test AI. Test the public URL tools.
printf 'Redo CLI upload smoke test.\n' > smoke-note.txt
redo upload smoke-note.txt --local
redo list media --local
redo chat "Reply with exactly: CLI smoke ok" --no-tools --model flash --local
redo sessions --local
redo query https://example.com "What is this page?" --local
redo extract https://example.com --colors --fonts --local Known limits
Some tools need more than the CLI.
- Screenshots need Cloudflare Browser Rendering keys in the local API.
- Query and extract block localhost URLs on purpose.
- Use a test site for publish checks.
Clean up
Delete only what the smoke test made. The delete command asks first. In a script use --yes.
redo delete page <page-id> --yes --local
redo delete media <media-id> --yes --local
redo logout --all Ready to publish
The CLI is ready when all of this works from the scratch folder.
- The dry run package is small.
redoworks.cmsworks.- Login works.
- Read and write commands work.
- Pull and push work.
- Media works.
- AI works.
- The test mess is cleaned up.