Reach a private API without a browser: the CLI agent

Send a request to localhost or a private network through a small program on your own machine.

In short

The CLI agent is a small program you start on a machine that can reach your private API. A request {{brand}} could not send ("Not sent") can then be sent through it, and the answer comes back to the page. It needs no browser, so it also works on a build server.

Before you start

Steps

  1. Install the CLI on the machine that can reach your API, with the install line "Run in CI" shows on a suite. It needs .NET 10.
  2. Create an access token in Settings, under Access tokens, for the agent alone: choose "API Tester CLI agent", "Read and write", and nothing else.
  3. Put it in the environment variable KAMOCORE_TOKEN on that machine.
  4. Start the agent and name what it may send to: kamocore agent --allow localhost:5000
  5. Leave it running. Press Ctrl+C to stop it.
  1. Open a request whose address is on your machine or network and press "Send". It is recorded as Not sent.
  2. Check that "Agent connected from" and your machine's name shows under the message.
  3. Press "Send through my agent".

Result: the answer comes back to the page and is recorded as a run marked as sent through your agent.

  1. Keep the agent running on a machine that stays on.
  2. Open Monitors and create or edit a monitor of one request or one suite that runs as you.
  3. In "Sends from", choose "Your agent on" and your machine's name, then save.

Result: every check of that monitor is sent from your machine. Its properties say "Sends from" your agent, and a check made while the agent was not connected is marked Not sent, never failed. When the request signs in with an OAuth profile whose token address is inside your network, the agent fetches that token too.

Good to know

If something goes wrong

Related