CLI

The GOX CLI allows you to create projects, run the server, manage customer dependencies and frameworks, inspect the module graph and run tests.

The commands are run from the terminal by gox. The operations that act on an application must start within its project structure.

The installation and synchronization of packages is developed together in Dependencies. The consultation of direct and transitive dependencies is documented in list.


Use

bash
gox <command> [options]
CommandDescription
createprojectIt creates a GOX project.
runCollect and run the server.
getAdd a dependency.
removeIt eliminates a dependency.
installInstall the declared dependencies.
tidySynchronize the Go modules.
listIt shows the project dependencies.
clientManages customer frameworks.
graphShow the dependency graph.
testRun tests and benchmarks.

Help

The general aid can be consulted in these two ways:

bash
gox help
gox --h

Working directory

GOX uses the current directory as a starting point. The commands that need to know the project detect its root before carrying out the operation.

createproject uses the current directory as the destination of the new project. Other commands, such as client, manage the project files directly from the directory in which they are run.


Errors

An unknown command, an invalid option or an unallowed combination of arguments ends with an error and an output code other than zero.

The aid does not run the command or modify the project.


Best practices

  • Run the project commands from its root.
  • See the general help when you need to review the available commands.
  • Check the changes produced in configuration files and modules.
  • It uses only documented options for the installed version.
  • Run the tests after changing dependencies or frameworks.

Next step

Continue with createproject to create the initial structure of a GOX application.

createproject