← All posts

Run your first AI agent.
Keep the result.

Install the Method SDK, sign in, run a checked script, and inspect the saved output and the version on your dashboard.

Orange and blue steps rise toward a circle on warm paper.

Before you start

You need Node.js 22 or later. This example uses local scripts and makes no model calls. Read a method before you run it, and start in an empty test folder.

The local SDK does not transfer browser sessions or set up cloud accounts. Use your existing local tools and connections. See pricing for the plans.

1. Install and sign in.

npm install -g https://app.withmethod.ai/downloads/method-ai-hq-sdk-latest.tgz
method login

Sign-in opens your browser. When this computer is signed in, each run of a changed file saves a version, and the run appears on your dashboard. This example runs two local scripts and makes no model calls.

2. Prepare an empty working folder.

mkdir method-first-run
cd method-first-run
curl -fL https://withmethod.ai/examples/checked-file.method -o checked-file.method
for file in save-text.mjs check-text.mjs; do
  curl -fL "https://withmethod.ai/examples/$file" -o "$file"
done
printf '%s\n' '{"text":"Hello from Method.\n"}' > inputs.json
method validate checked-file.method

This method writes the supplied text to a file and checks it. Read it before continuing. A successful validation checks the document and local setup without running the task.

3. Run it locally.

method run checked-file.method --inputs inputs.json --workspace . --run-dir .runs/first

Method runs the save script and then a separate check script. It saves the returned file and run records under .runs/first. The expected file text is shown below; this is a sample output, not a report from a customer run.

Hello from Method.

4. Inspect the evidence.

method inspect .runs/first --out inspection.json --include-files

Read inspection.json, summary.json, and result.json. Check the final status, the returned file, and the check evidence. A failed or unknown check needs review. Do not treat a file’s presence alone as a successful run.

5. Find the version on your dashboard.

The signed-in run saved the file as a version, and its last line names the version and the dashboard link. The first save writes an id: line into the file. It links the file to its Method; keep it. Change the text in inputs.json and run again: the save step runs again because its input changed, and the new run shows next to the first one.

If the upload fails, the run says that it will save when online. Use method sync RUN_DIRECTORY after reviewing the run. Do not repeat a business action just to repair an upload. To share or schedule a version, run method publish checked-file.method --reason TEXT.

If the run does not finish

  • Missing runtime setup: read method authoring execution and check the Method's models and this computer's bindings (method config).
  • Invalid method: run method validate FILE and correct the named field.
  • Failed check or timeout: inspect the run before any retry. Use method authoring recovery for resume rules.
  • New input or changed instructions: use a new run directory.

For all command options, run method COMMAND --help. Read the full documentation for the format, executor, SDK, and API. The complete offline manual is available with method authoring all.

Make the next run better.