skip to content
ccdocs

cc shell

Manage cc's shell integration — the cc function, daemon auto-start, and prompt-segment helper that get written to your rc file.

Usage

cc shell                          # status (default)
cc shell status                   # check whether integration is installed
cc shell install                  # install/reinstall for current shell
cc shell install --shell fish     # force fish even if zsh is detected
cc shell install --force          # reinstall when already installed

Subcommands

SubcommandDescription
status (default)Print whether integration is installed for the detected shell
installWrite the integration file + append source line to your rc file

Flags

FlagDescription
--shell {zsh|fish}Force a specific shell (auto-detected from parent process / $SHELL otherwise)
-f, --forceReinstall even when integration is already in place

What it installs

Writes a small shell file (~/.cc-cli/shell/cc.zsh or ~/.cc-cli/shell/cc.fish) that defines:

  1. cc shell function — wraps _cc_internal with a CC_RUN_FILE env var. Lets cc switch / cc cd / switch hooks change your shell's working directory and activate pyenv venvs by writing shell commands that get sourced in the parent shell.
  2. Daemon auto-start — silently starts cc daemon if the socket isn't already up.
  3. prompt_cc_env helper — a powerlevel10k segment showing the active environment name. Reads the active env directly from ~/.cc-cli/cc_cli.db for zero latency.

Then appends a source ~/.cc-cli/shell/cc.zsh line (or fish equivalent) to your ~/.zshrc or ~/.config/fish/config.fish.

After install

source ~/.zshrc                   # or source ~/.config/fish/config.fish

To pick up the function in the current terminal. New terminals get it automatically.

For zsh + powerlevel10k users:

# Add 'cc_env' to POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS in ~/.p10k.zsh

When to use this manually

cc setup and install.sh install shell integration automatically on first run. Use cc shell install standalone when:

  • Your dotfiles got reset and the source line is gone
  • You switched from zsh to fish (or vice versa)
  • The cc function stopped working and you want to reinstall fresh
  • cc setup — first-time wizard (includes shell integration as a step)
  • cc daemon — daemon lifecycle (auto-start lives in the shell integration)

On this page