Skip to content
GlxymeshDocs
glxymesh.com
Select theme
Open console
Reading time 5 minLevel Beginner

Learn the CLI step by step

Understand the gxmesh workflow from sign-in and project selection to scaffolding, local calls, tests, deployment and client connection.

Use gxmesh to build and deploy tools. Use codex, claude, or another MCP client to call those tools from a conversation. They are separate programs with separate sign-ins.

This walkthrough creates a greeting tool without external API keys. You need a Glxymesh account, the gxmesh CLI, and a local toolchain for your chosen language.

Notation Meaning
gxmesh The program you run in a terminal
new greet The command and its argument: create a tool named greet
--lang node An option and its value; node selects TypeScript
<slug> A placeholder to replace; do not type the angle brackets
[--approve] An optional flag in reference syntax; omit the brackets when using it
'{"name":"Ada"}' One JSON argument, quoted so the shell keeps it together

Run blocks one at a time. Read the result before moving to the next block. The examples use acme as the organization; replace it with an organization you belong to.

Terminal window
gxmesh version
gxmesh login
gxmesh org
gxmesh org use acme
gxmesh project create hello "Hello tools"

version confirms the CLI is installed. login prints a browser URL and a device code: complete that sign-in first. org lists the organizations your account can access. org use selects one, and project create creates the hosted destination called hello. If it already exists, use gxmesh project use hello instead of creating it again.

Terminal window
mkdir hello-tools
cd hello-tools

Pick one language:

Terminal window
gxmesh init --lang node --org acme --project hello
npm install

Node.js LTS runs the tools locally. node is the configuration value for TypeScript projects.

init writes gx.yml, language configuration, tools/ and .gitignore in this directory. It does not deploy anything. The explicit --org and --project values make the destination clear.

Terminal window
gxmesh new greet

This creates tools/greet/tool.yml and a greeting function in your project’s language. The generated input is named name. Open both files: tool.yml describes the interface the model sees, and the function implements it. The default kind is function; gxmesh new lookup --kind http creates a request template instead, which you must configure before calling it.

Terminal window
gxmesh call greet '{"name":"Ada"}'
gxmesh test greet

call runs the tool on your machine and prints its result and diagnostics. The scaffold greets Ada. test greet runs the tests: entries in that tool’s tool.yml. Run gxmesh test for all tools. Both commands regenerate the typed inputs; use gxmesh gen when you only want to refresh editor types.

Change the generated test to check its result, not only that the call succeeds:

Inside tools/greet/tool.yml
tests:
- input: {name: Ada}
expect: {contains: Ada}

Run gxmesh test greet again. If a check fails, correct the tool or its test before deploying.

Terminal window
gxmesh dev

Leave this terminal running. It serves http://127.0.0.1:7777/mcp and rebuilds on changes. In a second terminal, choose your client:

Terminal window
codex mcp add hello-local --url http://127.0.0.1:7777/mcp
codex

Ask: “Use hello-local to greet Ada.” Inspect /mcp inside the client if the tool is missing. The local server needs no OAuth sign-in and must run on the same machine as the client. Ctrl+C stops it.

Back in the project directory:

Terminal window
gxmesh push
gxmesh revisions
gxmesh connect

push validates and sends the project to Glxymesh. The platform builds it, runs its tests and makes a revision live if they pass. New network hosts or secret access require approval during the push. revisions shows which revision is live. connect prints the hosted URL and client setup instructions.

The hello project in acme uses https://acme.mcp.glxymesh.com/hello. Connect it under a different name from hello-local; follow the client connection guide to add it and complete the hosted OAuth sign-in. Call greet and check Invocations in the console.

Edit a tool, run gxmesh test, then gxmesh push again. Your connected clients keep the same URL. If you need to restore an earlier deployed version, first inspect gxmesh revisions, then use the actual revision identifier from that list:

Terminal window
gxmesh rollback r1

This changes the live deployment; it does not rewrite the files on your machine. Update your local source before your next push if you want to keep the restored behavior.

Inside a project, gx.yml identifies the destination. Outside one, commands such as connect use the active organization and project. init accepts scope flags; outside a project, the environment variables GXMESH_ORG and GXMESH_PROJECT can override the stored selection. For an existing project, check its gx.yml before pushing; push does not accept scope flags to redirect the deployment. See the full command reference for every command and option.

If you see Next step
gxmesh: command not found Open a new terminal after installation and check that the install directory is on PATH.
No gx.yml Change into the initialized project directory, or run gxmesh init in a new one.
A build or dependency error Check the toolchain for your lang; for Node projects, run npm install.
A JSON parse error Use the quoting example for your shell and double quotes around JSON keys and strings.
A host or key approval prompt Review the changes in tool.yml; approve only the access the tool needs.