gio help
Print the gio command list or one command's options; gio --version prints the CLI, server binary and @gio.js/core versions.
gio help [command]
gio --help # -h
gio <command> --help # same as gio help <command>
gio --version # -vReference
| Parameter | Type | Default | Description |
|---|---|---|---|
[command] | string | - | A command name (dev, cache, ...). Without it, the command list. An unknown name is a usage error. |
Behavior
$ gio --help
Usage: gio <command> [options]
Commands:
dev Start the development server (file watcher, error overlay)
start Start the production server
build Explain deploys; `gio build standalone` packages a deploy directory
export Render the app to static HTML in out/
routes List the app's routes (pages, route handlers, WebSockets, metadata)
typegen Write .gio/routes.d.ts (typed routes) without starting the server
doctor Check the environment and project for problems
info Print versions and environment details for bug reports
cache Explain how the cache served a URL (`gio cache explain <url>`)
bench Load-test a running server
migrate Migrate a Next.js app to GioJS (runs create-giojs migrate)
add Add a feature to this app (runs create-giojs add)
help Show help for a command
Options:
-h, --help show help (also: gio help <command>, gio <command> --help)
-v, --version show the CLI, server binary and @gio.js/core versions
Exit codes:
0 success
1 the command failed (server exited with an error, doctor found errors,
no server binary, route conflict, ...)
2 usage error (unknown command or option, missing argument)
Docs: https://giojs.com/docs/cligio helpandgio --helpprint to stdout and exit with0.giowith no command prints the same text to stderr, addsTo start the server: gio dev (development) or gio start (production)., and exits with2.gio help <command>prints the command's usage, summary and options. Formigrate,addandbuild standalone, the command's own--helphas the full option list (the first two come fromcreate-giojs).- Anything more is a usage error, exit
2:gio help dev extra,gio --help dev(it suggestsgio help dev),gio --version --bogus, or an unknown name ingio help <command>.
gio --version
Prints three lines and exits with 0, even when no binary is installed (not installed (...)). Each version is a package version, read from the installed package.json: gio is @gio.js/server's, the server binary is its platform package's (@gio.js/server-<platform>), and @gio.js/core is the installed package's. The binary is never run to ask. A binary from GIO_SERVER_BIN or a repository build has no package, so its line shows where it came from and its path instead of a version.
$ gio --version
gio 0.1.0-beta.8 (@gio.js/server)
server binary 0.1.0-beta.8 (@gio.js/server-darwin-arm64)
@gio.js/core 0.1.0-beta.8Exit codes
| Code | Meaning |
|---|---|
0 | Success. |
1 | The command failed: the server exited with an error (its own code is passed through), gio doctor found an error, no server binary, a route conflict, an unreachable server. |
2 | Usage error: unknown command or option, a missing or malformed argument. |
Commands that run their own parser keep the same codes: gio build standalone, gio bench, gio migrate and gio add exit with 2 for a usage error, before doing anything.
Examples
A mistyped command
$ gio strat
gio: unknown command "strat" - did you mean `gio start`?
Run `gio --help` for usage.Close misspellings and unambiguous prefixes (gio doc) get a suggestion. Words people type out of habit get a pointer:
| You type | Suggested |
|---|---|
gio serve, gio run | gio start |
gio create, gio new, gio init | npm create giojs@latest |
gio version | gio --version |
gio lint | your linter directly (GioJS has no lint command) |
One command's options
$ gio help cache
Usage: gio cache explain <url-or-path> [--base <url>]
Explain how the cache served a URL (`gio cache explain <url>`).
Requests the URL from the running server and decodes its X-Gio-Cache
header: hit, stale (revalidating), miss; stored, bypass, static or ppr.
...Good to know
- Every command parses its options strictly: an unknown option is an error with a suggestion, never ignored, and a bare
gionever starts a server. - Help text loads nothing else, so
gio --helpanswers instantly even in a broken install.
Related
Version history
| Version | Changes |
|---|---|
v0.1.0-beta.8 | Introduced: gio help, --help on every command, --version, did-you-mean errors and exit code 2 for usage errors, in every command. A bare gio prints the help instead of starting the server. |