Skip to content
Documentation

CHAMPREP Code commands

champrep code works with CHAMPREP Code from your terminal: projects and branches, bulk cloning, merge requests, issues, pipelines and job logs, CI runners, and releases. It acts as you, with your normal CLI sign-in, so Code applies your role in each project, your plan, and your quotas exactly as the web app does.

  1. Install the CLI and sign in with champrep auth login.
  2. Your plan must include CHAMPREP Code. When it does not, commands stop with not available to your account (exit code 1).
Terminal window
champrep auth login
champrep code projects ls

Naming projects, merge requests and issues

Section titled “Naming projects, merge requests and issues”
  • PROJECT is the project’s full path, such as acme/web, or its ID. The path is the easiest to type.
  • Merge requests and issues are numbered per project. Pass the number: 12 and !12 both name merge request 12, and 34 and #34 both name issue 34.
  • PIPELINE_ID and JOB_ID are the numbers shown by pipelines ls and jobs ls.
CommandPurpose
champrep code projects lsList the projects you are a member of. --search TEXT, --all (also public and internal projects you can see), --limit N.
champrep code projects show PROJECTShow a project, its default branch, and its clone addresses.
champrep code projects create NAMECreate a project in your personal namespace, or in a group with --namespace. Also --path, --visibility private|internal|public, --description, --default-branch.
champrep code repo clone-url PROJECTPrint the HTTPS clone address (--ssh for the SSH address).
champrep code clone PROJECT...Clone projects into --dest (default .), each under its namespace: DEST/<group>/<subgroup>/<project>.
champrep code clone --group GROUPClone every project of a group; --include-subgroups adds every subgroup.
champrep code clone --membership / --owned / --allClone every project you are a member of, where your role is Owner, or that you can see.
champrep code branches ls PROJECTList branches with their last commit. --search, --limit.
champrep code ssh-keys lsList the SSH keys on your Code account.

code clone options:

  • --ssh, or --https (the default), picks the protocol.
  • --dry-run lists what would happen.
  • --parallel N runs N git operations at once (default 4, at most 16).
  • --archived includes archived projects.
  • --update fetches and fast-forwards projects already cloned instead of skipping them. A clone whose origin is another repository is reported as mismatch. A detached HEAD or a branch without an upstream is reported as no-upstream.
  • --search TEXT keeps only the projects that match.
  • --max-projects N handles at most N projects (default 1000), counted after the --owned filter.

It prints a summary and exits 1 when any project failed or the run was interrupted (Ctrl-C stops new clones and the running ones). With --json it prints one entry per project with its status.

A bulk clone never prompts. git runs with GIT_TERMINAL_PROMPT=0, and SSH runs with BatchMode=yes unless you set GIT_SSH_COMMAND or core.sshCommand yourself. Only https:// and SSH addresses on the CHAMPREP Code host are cloned, and git runs with every other transport disabled.

git authenticates on its own. Use an SSH key, or a personal access token kept by git’s credential store, both set up once in the Code web app; see set up git credentials. The CLI never puts a token in a remote URL or in .git/config.

mr also accepts merge-requests.

CommandPurpose
champrep code mr ls PROJECTList merge requests. --state opened (default), merged, closed, locked or all; --mine; --search; --limit.
champrep code mr show PROJECT IIDShow a merge request, its merge status, and its head pipeline.
champrep code mr create PROJECTOpen a merge request. Requires --source, --target and --title; also --description, --draft, --remove-source-branch, --squash.
champrep code mr merge PROJECT IIDMerge now, or with --auto when the pipeline succeeds. Also --squash, --remove-source-branch, --message, --sha.
champrep code mr approve PROJECT IIDApprove. --sha pins the approval to the commit you reviewed.
CommandPurpose
champrep code issues ls PROJECTList issues. --state opened (default), closed or all; --labels a,b; --search; --mine (assigned to you); --limit.
champrep code issues show PROJECT IIDShow an issue.
champrep code issues create PROJECTCreate an issue. Requires --title; also --description, --labels, --confidential, --due YYYY-MM-DD.
champrep code issues close PROJECT IIDClose an issue.
champrep code issues reopen PROJECT IIDReopen a closed issue.

pipelines also accepts pl.

CommandPurpose
champrep code pipelines ls PROJECTList pipelines, newest first. --ref, --status, --limit.
champrep code pipelines show PROJECT PIPELINE_IDShow a pipeline and every job in it.
champrep code pipelines run PROJECT --ref REFRun a pipeline on a branch or tag. --var KEY=VALUE adds a variable (repeatable).
champrep code pipelines retry PROJECT PIPELINE_IDRetry the failed and canceled jobs.
champrep code pipelines cancel PROJECT PIPELINE_IDCancel a running pipeline.
champrep code pipelines wait PROJECT [PIPELINE_ID]Wait for a pipeline to finish: the given one, the newest of a commit with --sha SHA (or --sha HEAD in the repository; it waits for the pipeline to appear), or the newest on --ref BRANCH at that moment (default: the default branch). After a push, use --sha: --ref can still find the previous commit’s pipeline. Checks with a growing interval (5 s up to 60 s); progress and the final status line go to stderr, and --json prints the finished pipeline. A scheduled (delayed) job keeps it waiting. Exits 0 on success, 1 when it failed, was canceled or skipped, or stopped at a manual job (--manual-ok accepts that), and 8 when --timeout (default 60m) runs out.
champrep code jobs ls PROJECTList jobs, newest first, or one pipeline’s jobs with --pipeline ID. --status failed,running; --limit.
champrep code jobs log PROJECT JOB_IDPrint a job’s log. --tail N prints the last N lines, read from the end of the log, so it works on a log of any size. --follow (-f) keeps printing until the job finishes; the closing “Job N finished” line goes to stderr, so stdout holds only the log, and the exit code is the job’s outcome: 0 when it succeeded, 1 when it failed or was canceled. A log larger than 8 MiB needs --tail or --follow, which then starts from its last 100 lines.
champrep code jobs play PROJECT JOB_IDStart a manual job. --var KEY=VALUE passes a job variable.
champrep code jobs retry PROJECT JOB_IDRetry a finished job.

runners also accepts runner.

CommandPurpose
champrep code runners lsList the project and group runners you manage. --project PROJECT (runners the project can use; Maintainer), --group GROUP (Owner), --all (instance administrators). Filters: --status online|offline|stale|never_contacted, --paused / --active, --tag a,b, --type instance|group|project, --search, --limit.
champrep code runners show RUNNER_IDShow status, online, paused, tags, last contact, machines, and assigned projects or groups.
champrep code runners update RUNNER_ID--tags a,b replaces the tag list; --add-tag / --remove-tag (repeatable) change it by reading the tags and writing the whole list back, so a change someone makes in between is overwritten; --pause / --resume; --description.
champrep code runners createCreate a project runner (--project, Maintainer) or a group runner (--group, Owner). Also --description, --tags, --no-untagged, --protected, --locked, --paused. Prints the runner authentication token (ccrt_…) once on stdout and never logs it. Always needs --yes. Alias register.

Connect a machine to a new runner with champrep-code-runner register. Resetting a runner token and creating instance runners stay in the web app.

CommandPurpose
champrep code releases ls PROJECTList releases, newest first. --limit.

Lists show 20 rows by default. Raise --limit (up to 500) to see more; the CLI says so when more rows exist, and at --limit 500 it asks you to narrow the filters instead. jobs ls --pipeline ID --status S filters on your side after reading the pipeline’s first 500 jobs, and says when more may exist.

More task-by-task recipes, with scripting variants, are in Common tasks.

Clone a whole group, with its subgroups, and keep it up to date:

Terminal window
champrep code clone --group acme --include-subgroups --dest ~/src --ssh
champrep code clone --group acme --include-subgroups --dest ~/src --ssh --update

Clone a project and open a merge request for your branch:

Terminal window
git clone "$(champrep code repo clone-url acme/web)"
champrep code mr create acme/web --source feature/login --target main \
--title "Add login page" --remove-source-branch --yes

Review open merge requests and merge one when its pipeline passes:

Terminal window
champrep code mr ls acme/web
champrep code mr show acme/web 12
champrep code mr merge acme/web 12 --auto --squash --yes

Run a pipeline, wait for it, and follow a job’s log:

Terminal window
champrep code pipelines run acme/web --ref main --var DEPLOY=staging --yes
champrep code pipelines wait acme/web --ref main && echo "main is green"
champrep code pipelines ls acme/web --ref main --limit 5
champrep code pipelines show acme/web 9921
champrep code jobs log acme/web 4182 --follow

Find failed jobs and retry one:

Terminal window
champrep code jobs ls acme/web --status failed
champrep code jobs log acme/web 4180 --tail 50
champrep code jobs retry acme/web 4180 --yes

Track issues:

Terminal window
champrep code issues ls acme/web --labels bug --search login
champrep code issues create acme/web --title "Login fails on Safari" --labels bug,web
champrep code issues close acme/web 34 --yes

Commands that change something important ask before they act: mr create (opening a merge request can start a pipeline), mr merge, mr approve, issues close and reopen, runners update, and every pipeline and job action (run, retry, cancel, play), which use CI minutes. runners create always needs --yes, also on a terminal, because it prints a credential. clone changes only your disk and does not ask. On a terminal, answer y. In a script, pass --yes (-y). Without a terminal and without --yes the command refuses and changes nothing.

Creating a project or an issue does not ask. Creates, merges, pipeline runs, retries and cancels, and job plays and retries carry an idempotency key, so the CLI’s automatic retry after a network error never does the work twice.

The CLI refuses a project, merge request, issue, pipeline or job argument with a . or .. path segment before sending anything.

Add --json to print what Code returned: lists print a JSON array of items, pipelines show prints { "pipeline": …, "jobs": [ … ] }.

Terminal window
champrep code mr ls acme/web --json | jq -r '.[] | "\(.iid) \(.title)"'
MessageWhat to do
needs your web session … (SESSION_REQUIRED)Merging or approving into a protected branch is a decision only you can take, signed in to the CHAMPREP Code web app. Open the merge request in your browser and merge or approve it there. Unprotected branches work from the CLI.
not allowed for your role … (MERGE_NOT_ALLOWED), (PROJECT_ARCHIVED)Your role in the project does not allow the action, or the project is archived (read-only). Ask a Maintainer or Owner.
not available to your account …Your plan or organization policy does not include CHAMPREP Code or this feature. See plans or ask your administrator.
quota exceeded …, payment required …Your plan’s capacity or CI minutes are used up. Add capacity in CHAMPREP Billing, then run the command again.
not found …The project, merge request, issue or pipeline does not exist, or you cannot see it.
http 409 … (SHA_MISMATCH)The merge request moved since you looked. Check mr show and try again.

Exit codes follow the command reference: every refusal above exits 1, including --json runs; 3 means you need to sign in again, 5 a gateway rate limit, 6 a network failure and 7 a service failure that retries did not get past. pipelines wait exits 1 when the pipeline did not succeed and 8 when its --timeout ran out; jobs log --follow exits 1 when the job failed or was canceled. Both wait and retry on their own through service errors, rate limits and network failures, and give up after eight retries in a row.