MyCarTracks CLI

MyCarTracks CLI lets you work with the MyCarTracks API v3 from your terminal. It is useful for developers, internal automation, exports, reports, support checks, and AI agents that can run shell commands.

The CLI is based on Restish. Restish reads the MyCarTracks OpenAPI document and generates commands from the current API. When new API operations are published, you can sync the API specification and use the updated commands without installing a separate MyCarTracks binary.

What you can do

Use the CLI to:

  • List vehicles, tracks, users, groups, jobs, geofences, and other API resources.
  • Export API responses as JSON or YAML.
  • Filter command output for reports and scripts.
  • Build read-only fleet checks for operations or support teams.
  • Give a shell-capable AI agent a safe way to inspect MyCarTracks data.

Before you start

You need:

  • Restish installed on your computer.
  • MyCarTracks API credentials.
  • The official MyCarTracks CLI configuration from GitHub.

If you do not have API credentials yet, create them first: Where to get your API credentials?

Install Restish

Install Restish with Homebrew:

brew install rest-sh/tap/restish

Or install it with Go:

go install github.com/rest-sh/restish/v2/cmd/restish@latest

Get the CLI configuration

Clone the official MyCarTracks CLI repository:

git clone https://github.com/mycartracks/mycartracks-cli.git
cd mycartracks-cli

The repository contains a .restish.json file that connects Restish to the MyCarTracks API v3 base URL:

https://mycartracks.com/services/rest/v3

Restish uses the public OpenAPI document to build the command list:

https://mycartracks.com/services/rest/openapi.json

You can also browse the API documentation here:

Configure the CLI

Trust the project configuration once:

restish config trust

Sync the MyCarTracks API specification:

restish --rsh-profile public api sync mycartracks

The public profile is only used to download the public API specification. Your API commands still use your own credentials.

Set your MyCarTracks API credentials:

export MYCARTRACKS_CLIENT_ID="your-client-id"
export MYCARTRACKS_CLIENT_SECRET="your-client-secret"

By default, the CLI requests a read-only OAuth2 token.

Run your first commands

Show all available MyCarTracks commands:

restish mycartracks --help

List vehicles:

restish mycartracks list-vehicles --limit 10

List tracks:

restish mycartracks tracks --limit 10

Show help for a specific command:

restish mycartracks tracks --help

Output and filters

Return vehicle data as JSON:

restish mycartracks list-vehicles --limit 10 -o json

Return vehicle data as YAML:

restish mycartracks list-vehicles --limit 10 -o yaml

Show only selected fields:

restish mycartracks list-vehicles --limit 10 -q 'data[].{id:id,name:name}'

List tracks for one vehicle:

restish mycartracks tracks --vehicleIds 123 --limit 50

Use command help to see the available filters for each API operation:

restish mycartracks tracks --help

Keep commands current

The CLI command list comes from the live MyCarTracks API documentation. Sync again when you want to refresh command names, parameters, or newly published operations:

restish --rsh-profile public api sync mycartracks

You can inspect how Restish sees the API metadata:

restish doctor api mycartracks

Read and write access

The default configuration uses the read scope. This is enough for listing vehicles, tracks, users, groups, jobs, geofences, map sharing links, and other available read operations.

If your API credentials are allowed to use write access, update .restish.json and change both scopes values from:

read

to:

read write

Only use read write when your credentials are allowed to create, update, or delete API data.

Use with AI agents

MyCarTracks CLI is not an AI-agent skill by itself. It is a command-line tool. If your agent can run shell commands, you can create a skill, workflow, or instruction file that tells the agent how to use restish mycartracks ... safely.

Good agent tasks include:

  • Check whether vehicles are returned by the API.
  • Summarize recent tracks for a selected vehicle.
  • Export vehicle or track data as JSON for another workflow.
  • Look for missing, stale, or suspicious fleet data.
  • Prepare an internal operations summary from read-only API responses.

For agent workflows, start with read-only credentials and ask the agent to show the command it plans to run before any write-capable action.

Example OpenClaw workflow

OpenClaw can run command-line agent tasks with openclaw agent. Use the MyCarTracks CLI repository as the workspace and make sure your API credentials are already set:

cd mycartracks-cli

export MYCARTRACKS_CLIENT_ID="your-client-id"
export MYCARTRACKS_CLIENT_SECRET="your-client-secret"

restish --rsh-profile public api sync mycartracks

Then ask the agent to use read-only CLI commands:

openclaw agent \
  --agent ops \
  --message "Use restish mycartracks list-vehicles --limit 100 -o json. Summarize vehicle IDs, names, and any obvious missing data. Do not modify anything."

For recent track review:

openclaw agent \
  --agent ops \
  --message "Use restish mycartracks tracks --limit 50 -o json. Summarize recent tracks by vehicle and note anything unusual. Do not call write commands."

OpenClaw agent names and model options depend on your own OpenClaw setup. Check the OpenClaw CLI documentation for the current command syntax:

Reusable agent prompt

Use this prompt with OpenClaw, Codex, Claude Code, or another shell-capable agent:

You are helping me inspect MyCarTracks fleet data.

Workspace:
- Use the current mycartracks-cli directory.
- Use Restish commands only.
- Use read-only API operations unless I explicitly approve otherwise.

Credentials:
- MYCARTRACKS_CLIENT_ID and MYCARTRACKS_CLIENT_SECRET are already set.

Task:
1. Run restish mycartracks --help to inspect available commands.
2. Run restish mycartracks list-vehicles --limit 100 -o json.
3. Run restish mycartracks tracks --limit 50 -o json.
4. Summarize vehicles, recent tracks, and any missing or suspicious data.
5. Include the exact commands used.
6. Do not change API data.

Optional skill file

Some agent systems let users create skills or reusable instructions. A customer can create a MyCarTracks skill that wraps the CLI and sets read-only defaults.

Example SKILL.md:

# MyCarTracks Fleet Data

Use this skill when the user asks to inspect MyCarTracks vehicles, tracks, positions, jobs, geofences, or fleet activity from the command line.

## Requirements

- Work inside the `mycartracks-cli` repository.
- Use `restish mycartracks ...` commands.
- API credentials must be available as `MYCARTRACKS_CLIENT_ID` and `MYCARTRACKS_CLIENT_SECRET`.
- Prefer read-only commands.

## Safety

- Do not use write commands unless the user explicitly approves the exact action.
- Do not print client secrets or bearer tokens.
- Do not edit `.restish.json` unless the user asks.

## Common commands

```sh
restish mycartracks --help
restish mycartracks list-vehicles --limit 100 -o json
restish mycartracks tracks --limit 50 -o json
restish mycartracks tracks --help
```

## Workflow

1. Sync the API spec if commands look stale:

```sh
restish --rsh-profile public api sync mycartracks
```

2. Run the smallest read-only command that answers the request.
3. Parse JSON output.
4. Summarize IDs, names, dates, and anomalies clearly.
5. Include the exact command used in the final answer.

Adapt the skill format to the agent platform you use. The important point is that the skill treats MyCarTracks CLI as a tool and keeps read-only behavior as the default.

Troubleshooting

If commands are missing or old, sync the API specification again:

restish --rsh-profile public api sync mycartracks

If authentication fails after changing credentials, clear cached tokens:

restish api auth logout mycartracks

If token fetching fails with invalid_scope, keep the default read scope unless your credentials are allowed to request write access.

If Restish says the project configuration is not trusted, run:

restish config trust

Or pass the config file explicitly:

restish --rsh-config ./.restish.json --rsh-profile public api sync mycartracks
restish --rsh-config ./.restish.json mycartracks --help

More links