@git.zone/cli 🚀
@git.zone/cli is the development workflow CLI behind the gitzone and gzone commands. It helps TypeScript-heavy teams keep projects tidy, create semantic source commits, manage local Docker-backed services, scaffold new modules, and release software through explicit, target-based release configuration.
It is opinionated where that saves time: source commits and releases are separate, changelog entries flow through a standard Pending section, project config lives in .smartconfig.json, and release targets make side effects visible before they happen.
Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit community.foss.global/. This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a code.foss.global/ account to submit Pull Requests directly.
Install
pnpm add -g @git.zone/cli
After installation, both binaries point to the same CLI:
gitzone --help
gzone --help
The Big Idea
gitzone commit handles source history.
gitzone release handles release transactions.
That split is intentional. A commit should not unexpectedly publish npm packages, push Docker images, or trigger remote release pipelines. A release should clearly show which targets it will publish to.
Quick Start
# Preview project standardization work
gitzone format
# Apply formatting changes
gitzone format --write
# Create a semantic source commit
gitzone commit
# Preview the configured release transaction
gitzone release --plan
# Release pending changelog entries to configured targets
gitzone release
Commands
| Command | Purpose |
|---|---|
commit |
Analyze changes and create one semantic source commit |
release |
Turn pending changelog entries into a versioned release and publish targets |
format |
Plan or apply project formatting and standardization |
config |
Inspect, update, and migrate .smartconfig.json |
services |
Manage local MongoDB, ObjectStorage, and Elasticsearch containers |
tools |
Manage the global @git.zone toolchain |
template |
Scaffold projects from built-in templates |
meta |
Manage multi-repository workspaces |
open |
Open repository assets like CI pages |
docker |
Report and reclaim Docker resources created by git.zone tooling |
deprecate |
Deprecate npm packages across registries |
start |
Prepare an existing project for local work |
helpers |
Run small helper utilities |
Global flags include --help, --json, --plain, --agent, --no-interactive, and --no-check-updates.
Toolchain Management
gitzone tools replaces the former gtools command from @git.zone/tools. It manages globally installed @git.zone development tools through pnpm.
# Check installed @git.zone tools and update outdated packages
gitzone tools update
# Update without prompts
gitzone tools update -y
# Install missing managed @git.zone tools
gitzone tools install
gitzone tools update checks @git.zone/cli first. If the CLI itself needs an update, it updates @git.zone/cli and asks you to rerun the command before updating the rest of the toolchain.
Commit Workflow
gitzone commit creates one semantic source commit. It does not bump versions, create tags, publish packages, or push Docker images.
# Interactive semantic commit
gitzone commit
# Read-only AI recommendation
gitzone commit recommend --json
# Auto-accept safe recommendations
gitzone commit -y
# Auto-accept a breaking recommendation explicitly
gitzone commit -y --allow-breaking
# Auto-accept, test, build, and push
gitzone commit -ytbp
# Show the resolved workflow without mutating anything
gitzone commit --plan
The commit flow:
- Analyze the working tree.
- Suggest commit type, scope, and message.
- Write a human-readable entry into
changelog.mdunder## Pending. - Stage and create one semantic source commit.
- Optionally run formatting, tests, build, and push based on flags or config.
Commit flags:
| Flag | Meaning |
|---|---|
-y, --yes |
Auto-accept safe recommendations |
--allow-breaking |
Allow -y/--yes to accept BREAKING CHANGE recommendations |
-t, --test |
Add test step |
-b, --build |
Add build step |
-p, --push |
Push after the source commit |
-f, --format |
Run gitzone format --write before commit |
--plan |
Show resolved workflow only |
-r is intentionally not part of commit anymore. Use gitzone release.
Release Workflow
gitzone release performs the release core once, then publishes to configured targets.
The release core is not configurable plumbing. It always follows the same professional release transaction:
- Run configured preflight checks.
- Read
changelog.md## Pendingentries. - Infer or accept a semver bump.
- Update version files and baked commit info.
- Move pending changelog entries into the new version section.
- Create the local release commit.
- Create the local release tag.
Targets decide what happens after that:
| Target | What it does |
|---|---|
git |
Pushes the release commit and tags, often triggering remote CI release builds |
npm |
Publishes the package to configured npm registries |
docker |
Delegates container builds and pushes to tsdocker |
# Preview the resolved release plan
gitzone release --plan
# Release to configured targets
gitzone release
# Release only to npm
gitzone release --target npm
# Release only to git and Docker
gitzone release --target git,docker
# Skip package/container publishing and keep only git target
gitzone release --no-publish
# Override inferred semver level
gitzone release --minor
Release flags:
| Flag | Meaning |
|---|---|
-y, --yes |
Run without interactive confirmation |
-t, --test |
Enable preflight tests |
-b, --build |
Enable preflight build |
-p, --push |
Enable the git target |
--target <csv> |
Use only selected targets, e.g. git,npm |
--npm |
Enable the npm target |
--docker |
Enable the docker target |
--no-publish |
Keep release core and git target only |
--no-build |
Disable preflight build for this run |
--major, --minor, --patch |
Override inferred semver level |
--plan |
Show resolved workflow only |
Standard Changelog
The changelog is convention-based and intentionally not configured.
gitzone commit appends entries to:
## Pending
gitzone release moves those pending entries into a dated version section:
## 2026-05-10 - 2.15.0
The standard buckets are Breaking Changes, Features, Fixes, Documentation, and Maintenance.
Configuration
CLI workflow config lives under @git.zone/cli in .smartconfig.json. Docker build and registry behavior lives under @git.zone/tsdocker and is used by the Docker release target.
{
"@git.zone/cli": {
"schemaVersion": 2,
"projectType": "npm",
"commit": {
"confirmation": "prompt",
"steps": ["analyze", "test", "build", "changelog", "commit", "push"]
},
"release": {
"confirmation": "prompt",
"preflight": {
"requireCleanTree": true,
"test": false,
"build": true
},
"targets": {
"git": {
"enabled": true,
"remote": "origin",
"pushBranch": true,
"pushTags": true
},
"npm": {
"enabled": true,
"registries": ["https://registry.npmjs.org"],
"accessLevel": "public",
"alreadyPublished": "success"
},
"docker": {
"enabled": true,
"engine": "tsdocker",
"registry": "registry.gitlab.com",
"buildRegistries": ["registry.gitlab.com"],
"test": true,
"patterns": [],
"cached": true,
"parallel": true
}
}
}
},
"@git.zone/tsdocker": {
"registries": ["registry.gitlab.com"],
"registryRepoMap": {
"registry.gitlab.com": "myorg/myproject"
},
"platforms": ["linux/amd64", "linux/arm64"]
}
}
NPM registries belong only here:
@git.zone/cli.release.targets.npm.registries
Canonical Docker destinations and repository mappings belong here. Registry
values should be hosts without http:// or https://:
@git.zone/tsdocker.registries
The Docker release target runs the project's pinned @git.zone/tsdocker through
pnpm exec; install it in each Docker-producing project:
pnpm add --save-dev @git.zone/tsdocker
Set release.targets.docker.registry to select one destination already declared
by the tSDocker config when a release must not publish to every configured
registry.
Set release.targets.docker.buildRegistries when the build should authenticate
only the configured registries used by private base images; an empty list keeps
the compatibility default of authenticating every configured registry. Bounded
build authentication requires project-local @git.zone/tsdocker 3.3.0 or newer.
Set release.targets.docker.test to true to require every selected image test
to pass before destination publication. This requires project-local
@git.zone/tsdocker 3.4.0 or newer.
Useful config commands:
# Show current @git.zone/cli config
gitzone config show --json
# Configure project basics, CLI behavior, and release targets interactively
gitzone config project
gitzone config cli
gitzone config release
# Validate schema, legacy keys, release targets, registries, and npm auth
gitzone config doctor
# Use opencode to repair configuration issues found by doctor
gitzone config fix
# Read the npm release target registries
gitzone config get release.targets.npm.registries
# Add an npm release target registry
gitzone config add https://registry.npmjs.org
# Set npm target access level
gitzone config access public
# Run schema migration to v2
gitzone config migrate 2
Managed Assets
Projects can opt into generated, updateable repository assets through @git.zone/cli.assets. The first supported kind is denoBinaryCli, which manages installer scripts, npm binary wrappers, postinstall downloaders, and Gitea release workflows for Deno-compiled CLI binaries.
{
"@git.zone/cli": {
"schemaVersion": 2,
"assets": {
"schemaVersion": 1,
"kind": "denoBinaryCli",
"cliName": "onebox",
"displayName": "Onebox",
"repository": {
"host": "code.foss.global",
"path": "serve.zone/onebox",
"branch": "main"
},
"installer": {
"enabled": true,
"installDir": "/opt/onebox",
"binDir": "/usr/local/bin",
"modes": {
"default": "binary",
"source": {
"enabled": true,
"commands": ["pnpm install --frozen-lockfile", "pnpm run build"],
"executable": "cli.js",
"executableFiles": ["cli.js", "cli.ts.js", "cli.child.js"],
"validate": "node cli.js --version"
}
},
"service": {
"detectNames": ["onebox"],
"refreshCommand": "onebox systemd enable",
"startHint": "onebox systemd start"
},
"ensureDirs": ["/var/lib/onebox", "/var/www/certbot"],
"preservePaths": ["/var/lib/onebox"]
},
"npmWrapper": {
"enabled": false
},
"releaseWorkflow": {
"compileCommand": "pnpm run build:binary",
"packNpmArtifact": true,
"assetGlobs": ["dist/binaries/*", "dist/package/*"]
}
}
},
"@git.zone/tsdeno": {
"compileTargets": [
{
"name": "onebox-linux-x64",
"entryPoint": "binary/onebox.ts",
"outDir": "dist/binaries",
"target": "x86_64-unknown-linux-gnu",
"permissions": ["--allow-all"],
"noCheck": true,
"selfExtracting": true
},
{
"name": "onebox-linux-arm64",
"entryPoint": "binary/onebox.ts",
"outDir": "dist/binaries",
"target": "aarch64-unknown-linux-gnu",
"permissions": ["--allow-all"],
"noCheck": true,
"selfExtracting": true
}
]
}
}
@git.zone/cli.schemaVersion remains the CLI config schema. @git.zone/cli.assets.schemaVersion is scoped to the managed asset model.
Managed assets are applied through the existing formatter workflow:
gitzone format plan --only assets --json
gitzone format check --only assets
gitzone format --only assets --write --yes
If npmWrapper.enabled is set, gitzone format --only packagejson --write also keeps package.json bin, scripts.postinstall, and npm package files entries in sync.
Set installer.distribution to "releaseAsset" when the installer itself should be published and documented as a Gitea release asset instead of a raw-branch file. That mode automatically stages install.sh into the release artifact directory unless releaseWorkflow.includeInstallerAsset is set explicitly.
Set installer.service.removeLegacyUnits to a list of systemd unit names when an installer must disable and remove older service units during upgrades.
Formatting
gitzone format is dry-run by default. That makes it safe to run in any repo.
# Preview changes
gitzone format
# Emit a machine-readable plan
gitzone format plan --json
# Fail when formatting changes or validator errors remain
gitzone format check
# Run a subset of formatters
gitzone format --only prettier,packagejson
# Apply changes
gitzone format --write
# Apply without prompt
gitzone format --write --yes
# Apply deterministic fixes, then use opencode for remaining issues
gitzone format fix
Formatters include cleanup, smartconfig normalization, dependency license checks, package metadata normalization, template updates, .gitignore, TypeScript config, Prettier, README existence checks, and configured copy operations.
gitzone format fix intentionally lives outside the default format path. Normal format runs stay deterministic; the fix command uses opencode only after deterministic formatters have done what they can.
Development Services
gitzone services manages local Docker-backed services for development projects.
Supported services:
| Service | Lifecycle/log aliases |
|---|---|
| MongoDB | mongo, mongodb |
| ObjectStorage (S3-compatible) | objectstorage, s3 |
| Elasticsearch | elasticsearch, es |
Service-selection commands such as set, enable, and disable also accept
elastic; lifecycle and log commands do not.
# Start configured services
gitzone services start
# Enable specific services non-interactively
gitzone services set mongodb,objectstorage
# Check status
gitzone services status
# Machine-readable status, including connection strings and data sizes
gitzone services status --json
# Print MongoDB Compass connection string
gitzone services compass
# Show logs
gitzone services logs mongo 50
Service config is stored in .nogit/env.json. Newly created config files use
owner-only permissions; writes are atomic and reject a stale in-memory snapshot
rather than overwriting a concurrent change. MongoDB, ObjectStorage, and
Elasticsearch data is stored in .nogit/mongodata,
.nogit/objectstoragedata, and .nogit/esdata, so it stays out of Git.
ObjectStorage uses S3_PORT for its local S3 API and S3_UI_PORT for its
management UI. S3_REGION defaults to us-east-1; S3_ADMIN_PASSWORD is a
separate randomly generated password for the UI's admin user. Startup rejects
empty credentials, admin/admin S3 defaults, the default admin password, and
an admin password reused as either S3 credential. gitzone services config --json replaces those three ObjectStorage credential values with "***".
Other fields are unchanged, including MongoDB and Elasticsearch passwords and
credential-bearing URLs, so the complete output must still be treated as
sensitive.
GitZone runs a digest-pinned ObjectStorage image with both the S3 API and
management UI published on loopback. S3_HOST, S3_ENDPOINT, S3_USESSL, and
the other generic S3 consumer fields remain user-controlled; service startup
always reconciles the local managed instance through 127.0.0.1 and its
configured local ports.
GitZone derives new bucket names from the project name using S3 naming rules.
When loading older configuration it repairs only the exact generated
<project>-documents value if that value is invalid; custom bucket names are
never rewritten. services start s3 validates the bucket and credentials,
recreates an owned container when its pinned image, ports, data bind, controlled
product environment, restart policy, command, entrypoint, user, or health check
drifted, waits for management readiness, then creates and verifies the bucket
through an authenticated S3 client. A GitZone-label mismatch is an ownership
conflict and blocks mutation rather than being treated as repairable drift.
Container setup, management readiness, and the S3 operations share one deadline;
SmartBucket cleanup has its own bounded close. Docker mutations use the
container's immutable ID after exact-name discovery.
On failure, GitZone stops a pre-existing container only after that invocation's
start returned successfully. A newly created ID remains invocation-owned across
an uncertain start and can be stopped safely; an uncertain pre-existing start is
left adoptable rather than risking stopping another concurrent invocation. A
canonical container created but not yet started remains stopped for a safe retry.
Migrating legacy MinIO state
Persisted minio and s3 service selections are rewritten to the canonical
objectstorage value. S3_CONSOLE_PORT is migrated to S3_UI_PORT when the
values do not conflict. The runtime migration also adds the separate admin
password and region fields and repairs only the exact invalid bucket name that
older GitZone versions generated. Legacy registry and data-marker entries are
retained as preserved migration evidence, not converted into active
ObjectStorage ownership. Every selected migration store is preflighted before
the first write. Closed-schema service selection, marker, and registry stores
reject malformed, conflicting, foreign, or future state without rewriting it.
Runtime config validates and migrates its known fields while preserving unknown
application fields.
If <project>-minio, a registry-retained alternate legacy container name, or
.nogit/miniodata still exists, ObjectStorage startup stops before mutating the
ObjectStorage container. In an untargeted services start, an earlier enabled
service such as MongoDB may already have started. GitZone never reuses, removes,
cleans, or prunes legacy MinIO state because its disk layout is not compatible
with ObjectStorage. Recovery is explicit:
- Export every required bucket with the existing MinIO tooling.
- Stop and rename the legacy container, then move
.nogit/miniodatato a preserved backup location. - Run
gitzone services start s3to create the canonical service. - Import through an external S3 client and verify the required objects before disposing of the backup.
An existing .nogit/objectstoragedata directory without a valid ownership
marker blocks creation of a new container and direct cleanup. One exception is
an existing container whose immutable identity and exact canonical GitZone
labels prove that directory belongs to this project; startup or removal repairs
the missing marker before proceeding. An invalid or foreign marker always
blocks mutation. Without that exact container proof, preserve or move the
directory, verify its provenance outside GitZone, start a fresh canonical
service, and import required objects through S3. Do not synthesize a marker for
unverified data.
Consuming a service programmatically
gitzone services status --json emits only JSON on stdout, so a test suite or
script can read a live connection string without parsing human output:
gitzone services status --json | jq -r '.services.mongodb.connectionString'
The ObjectStorage status key is .services.objectstorage; the former
.services.minio key no longer exists. Preserved predecessor evidence is
reported separately under .legacy. minioDataDirectory and minioDataExists
are always emitted; minioContainer is present only when container evidence
exists. Consumers must treat this as a breaking response-schema change rather
than interpreting legacy evidence as an active service.
Cleanup levels
Cleanup is tiered, from fully resumable to irreversible:
| Command | Containers | Data | Notes |
|---|---|---|---|
gitzone services stop |
kept (stopped) | kept | fully resumable |
gitzone services remove |
removed | kept | resumable; --yes to skip the prompt |
gitzone services clean |
removed | removed | irreversible; needs a typed yes or --yes |
gitzone services prune |
see below | see below | machine-wide; dry run unless --apply |
clean and prune first persist an exact deletion intent, then atomically rename
the canonical directory to a tokenized sibling quarantine before deleting any
contents. Native deletion is attempted there. If container-owned files remain,
GitZone uses a short-lived root container scoped to that quarantine; Docker's
--privileged mode is not used. The helper reserves one deterministic name per
bind target, carries a random invocation label, is created stopped, and is
inspected by immutable ID before execution or cleanup. Old stopped helpers can
be recovered only after their complete runtime envelope, bind target, age, and
immutable ID are proven; running, fresh, or noncanonical occupants block the
operation. If interruption or helper failure leaves bytes, the persisted intent
lets the next clean or prune --apply resume the same quarantine. A partial
failure therefore never leaves a corrupt directory at the canonical service
path. Startup refuses to create fresh service data while such an intent remains.
Service start, stop, container removal, and data removal share one interprocess lock per project and service. Startup refreshes runtime config and project activity inside that lock, while prune rechecks activity and stopped as well as running service containers after acquiring it. Concurrent lifecycle commands therefore serialize rather than deleting a directory or container while another command prepares, mounts, starts, or stops it.
Reclaiming space across projects
Service data is per project and survives container removal, so it accumulates.
gitzone services prune reports what every registered project holds and what
can be reclaimed. It is read-only unless --apply is passed:
# Report only: what exists, what is reclaimable, and why
gitzone services prune
# Change the inactivity threshold (default 30 days)
gitzone services prune --stale-days 90
# Actually reclaim, non-interactively
gitzone services prune --apply --yes
A project is only a candidate when there is positive evidence it is finished
with: its directory is gone, or it has been inactive past the threshold with no
container running. Anything ambiguous — an unlabeled container claimed by more
than one project, an unreachable Docker daemon, a directory still mounted by a
running container — is reported and skipped rather than reclaimed. Containers
are identified by an exact canonical GitZone label envelope. An unambiguous
registry claim is used only for older MongoDB and Elasticsearch containers with
no git.zone.* labels at all. ObjectStorage has no unlabeled predecessor
fallback; partial, missing, or conflicting GitZone labels fail closed. Removal
revalidates and uses the container's immutable ID, never its mutable name, so
pruning cannot touch a same-name replacement. If Docker becomes unavailable,
registry claims are preserved as well as containers and data.
Legacy MinIO containers and registry references are reported as preserved
migration resources and are never prune candidates. .nogit/miniodata is
deliberately outside the prune allowlist; current-project status reports its
presence, while machine-wide prune leaves it untouched.
MongoDB authentication
MongoDB runs as a single-node replica set with authentication enabled, so
multi-document transactions work. The managed container also uses a 65,536
soft/hard nofile limit so persistent, collection-heavy test suites do not hit
Docker's low default. services start reconciles legacy containers to this limit
by recreating only the container while preserving the bind-mounted data directory.
Authentication can be disabled per project for
runtimes whose node:crypto cannot complete a SCRAM handshake (notably Deno):
gitzone services auth mongodb off
gitzone services start mongo
This is opt-in and never implicit. With authentication disabled the database is
published on 127.0.0.1 only, and the combination of no authentication with a
non-local MONGODB_HOST is refused outright. Transactions continue to work, and
gitzone services status reports the mode. Re-enabling authentication over data
created without it bootstraps the configured root user through MongoDB's
localhost exception.
The setting is recorded in .smartconfig.json, so it is committed and a fresh
clone or CI run reproduces it without any manual step:
{
"@git.zone/cli": {
"services": ["mongodb"],
"serviceOptions": {
"mongodb": { "auth": false }
}
}
}
serviceOptions is a sibling of services, never a richer services
value. services must stay a flat array of canonical lowercase strings because
@git.zone/tsdeploy derives a workload's requiredCapabilities from it and
rejects any other shape.
A committed declaration takes precedence over .nogit/env.json, so a stale
local file cannot silently diverge from what the repository declares. When
nothing is declared, an existing local value is preserved. When neither exists,
authentication is enabled. Because a declaration affects everyone who clones the
repository, services status states where the setting came from:
⚠️ Auth: DISABLED (loopback only), declared in .smartconfig.json (applies to every checkout)
An older CLI that predates serviceOptions ignores the key and starts MongoDB
with authentication enabled — it degrades to the secure default, never the
insecure one.
Checking which version is running
gitzone --version prints the bare version on the first line, followed by the
path it resolved from. A stale copy in a legacy pnpm global root can otherwise
make it look like an older version is installed when it is not:
gitzone --version
# 3.2.1
# resolved from: /home/you/.local/share/pnpm/store/v11/links/@git.zone/cli/3.2.1/…
gitzone --version --json
# {"version":"3.2.1","resolvedFrom":"…"}
gitzone tools update also removes inert copies of managed packages left behind
in legacy global roots, provided the active root already supplies them and no
command shim still points there.
Templates
Start new projects with built-in scaffolds:
gitzone template npm
gitzone template service
gitzone template website
gitzone template wcc
Templates are rendered through SmartScaf and then can be normalized with gitzone format.
Meta Repositories
Use gitzone meta when one workspace coordinates multiple repositories.
gitzone meta init
gitzone meta add frontend https://example.com/org/frontend.git
gitzone meta update
gitzone meta remove frontend
Other Utilities
Docker resources
gitzone docker prune reports Docker containers and volumes created by
git.zone tooling, and reclaims them only when asked:
gitzone docker prune # report only
gitzone docker prune --apply # remove stopped tool-owned containers
gitzone docker prune --volumes # include tool-owned volumes in the report
gitzone docker prune --volumes --apply --yes
Scope is an allowlist: only resources labeled git.zone.tool=<tool> and
git.zone.safe-to-prune=true are ever considered. Anything unlabeled is
invisible to the command. Running containers and attached volumes are never
removed, and images are never removed at all. Volumes hold persisted data, so
they are excluded unless --volumes is passed and require a typed yes or
--yes on top of --apply.
This command deliberately cannot prune the whole machine. To do that, run
docker directly so the blast radius is explicit and yours.
Other utilities
# Open GitLab CI settings or pipelines for the current repo
gitzone open ci
gitzone open pipelines
# Deprecate an old npm package interactively
gitzone deprecate
# Prepare a project for local work
gitzone start
# Generate a short unique ID
gitzone helpers shortid
Troubleshooting
Format only previews changes:
gitzone format --write
Release says there is nothing to release:
# Make sure commits have populated the Pending changelog section
gitzone commit
Docker services fail to start:
docker info
gitzone services status
gitzone services reconfigure
Config looks outdated:
gitzone config migrate 2
gitzone config show --json
License and Legal Information
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the license file.
Please note: The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
Company Information
Task Venture Capital GmbH Registered at District Court Bremen HRB 35230 HB, Germany
For any legal inquiries or further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.