GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - KittyCAD/cli: The Zoo command line tool.

BranchesTags
Open more actions menu

Latest commit

 

History

1,943 Commits
1,943 Commits

Folders and files

NameName
Last commit message
Last commit date
.config
.config
 
 
.github
.github
 
 
assets
assets
 
 
cli-macro-impl
cli-macro-impl
 
 
cli-macro
cli-macro
 
 
scripts
scripts
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CODEOWNERS
CODEOWNERS
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
flake.lock
flake.lock
 
 
flake.nix
flake.nix
 
 
homebrew-template.rb
homebrew-template.rb
 
 
justfile
justfile
 
 
rust-toolchain.toml
rust-toolchain.toml
 
 
rustfmt.toml
rustfmt.toml
 
 
spec.json
spec.json
 
 

Repository files navigation

cli

The Zoo command line tool.

The instructions below refer to instructions for contributing to the repo.

For the CLI docs for end users refer to: https://zoo.dev/docs/cli/manual

Installing

On MacOS, you can use Homebrew:

brew tap kittycad/kittycad
brew install kittycad
zoo --help   

For all other installs, see the instructions on the latest release.

Updating the API spec

Updating the API spec is as simple as updating the spec.json file. The macro will take it from there when you cargo build. It likely might need some tender love and care to make it a nice command like the other generated ones if it is out of the ordinary.

Only create, edit, view/get, list, delete commands are generated. The rest are bespoke and any generation lead to something that seemed harder to maintain over time. But if you are brave you can try.

For examples of the macro formatting, checkout some of the commands under src/ like cmd_file or cmd_user.

Note: If you update the API spec here, you will likely want to bump the spec for the kittycad.rs repo as well since that is where the API client comes from.

Running the tests

Authenticated tests use ZOO_TEST_TOKEN and ZOO_TEST_HOST. Set these according to the deployment you want to test against.

export ZOO_TEST_TOKEN=$ZOO_API_TOKEN # dev or prod
export ZOO_TEST_HOST=$ZOO_HOST # dev or prod
cargo nextest run --no-fail-fast

Releasing a new version

  1. Make sure the Cargo.toml has the new version you want to release. When changing Cargo.toml, make sure to run cargo check to update Cargo.lock.
    cargo check
    
  2. Make sure you have toml-cli installed.
    cargo install toml-cli
    
  3. Run make tag this is just an easy command for making a tag formatted correctly with the version.
  4. Push the tag (the result of make tag gives instructions for this)
  5. Everything else is triggered from the tag push. Just make sure all the tests and cross compilation pass on the main branch before making and pushing a new tag.

Building

To build, simply run cargo build like usual.

Make sure to update to the latest stable rustc: for example, if you use rustup, run rustup update.

Cross compiling

If you're on Debian or Ubuntu, install the required dependencies by running .github/workflows/cross-deps.sh. Otherwise, look there to see what packages are required.

Then, simply run make. Binaries will be available in cross/.

If you want to only build one of the cross targets, supply the CROSS_TARGETS environment variable:

CROSS_TARGETS=x86_64-unknown-linux-musl make

If you get an error about md5sum on mac when running make release, you probably need to brew install coreutils

Generating

We use clap crate to rust doc comments and generate the markdown files.

This will generate gitignored markdown files under generated_docs/

make gen-md

Is the rust command to generate the markdown and see the stdout result.

cargo run generate markdown

About

The Zoo command line tool.

zoo.dev/docs/cli/manual

Resources

Readme
MIT license

Security policy

Security policy
Activity
Custom properties

Stars

29 stars

Watchers

8 watching

Forks

7 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.