# Resource (/cli/resource)



A **resource** is something the agent builds for you and saves: a **workflow** (code or agent logic that runs in the cloud on a schedule, a webhook, or a poll trigger), an **app** (an interactive React mini-app with server-side handlers), or a **skill** (a `SKILL.md` instruction bundle agents load as context). `geni resource` lets your AI agent build one on your machine using your own editor, while the cloud handles validation, configuration, publishing, and runs.

The shared lifecycle lives here; type-specific tools split off:

* **`geni resource`** — the shared lifecycle for any resource: create, pull, validate, wire config, publish.
* **[`geni workflow`](/cli/resource/workflow)** — workflow-only tools: test executions, triggers, switching type.
* **[`geni app`](/cli/resource/app)** — app-only tools: the build, running and inspecting handlers, browser errors.

The files live on your disk. The cloud is the brains: validation, the TypeScript and spec checks, the build, and every execution happen server-side. The CLI ships your files up and brings the results back.

## The build loop [#the-build-loop]

```sh
# 1. Scaffold a resource + its files into the current directory.
geni resource create --type code --name "Daily Digest"

# 2. Edit the files with your normal tools.
#    (Don't compile locally — @general-input/core only resolves server-side.)

# 3. Validate against the spec, credential wiring, and TypeScript. No publish.
geni resource validate

# 4. Wire credentials, consts, and schedules.
geni resource config set --cred slack=cred_01HX

# 5. Promote your files to the live version.
geni resource publish --summary "Posts a daily digest to Slack"

# 6. Verify it.
geni workflow test --payload '{}'          # workflows
geni app run-handler listCustomers         # apps
```

Load the matching [authoring skill](/cli/skills/load) first (`geni skills load <code-workflow|agent-workflow|app|skill-authoring>`) — its `references/` hold the type contract and a complete worked example — then iterate from step 2 until it does what you want.

<Callout type="info" title="Local files are the draft">
  `validate` checks your local files without persisting. `publish` promotes them
  to the live version. A test or handler run uses the **published** version, so
  publish before you test.
</Callout>

## The directory marker [#the-directory-marker]

`create` and `pull` drop a `.geni-resource.json` marker in the directory. Every other command resolves the resource id from that marker, so you can run them by id (`geni resource validate wf_123`) or just from inside the directory (`geni resource validate`).

## Four types [#four-types]

* [Code workflows](/cli/resource/code) — deterministic, fixed steps, API chaining. A single `main.ts` runs once per trigger.
* [Agent workflows](/cli/resource/agent) — LLM-driven, variable-length tasks (research, drafting, triage). An `instructions.md` SOP plus reusable scripts.
* [App resources](/cli/resource/apps) — an interactive React mini-app with server-side handlers (dashboards, internal tools).
* [Skills](/cli/resource/skill) — a `SKILL.md` instruction bundle agents load as context. Not executed, so it skips the config step and publishes without a `--summary`.

## Lifecycle commands [#lifecycle-commands]

| Command                              | What it does                                  |
| ------------------------------------ | --------------------------------------------- |
| [`create`](/cli/resource/create)     | Create a resource and scaffold its files.     |
| [`list`](/cli/resource/list)         | List the workflows you can access.            |
| [`get`](/cli/resource/get)           | Show one resource's detail.                   |
| [`pull`](/cli/resource/pull)         | Download a resource's live files to disk.     |
| [`validate`](/cli/resource/validate) | Validate local files without publishing.      |
| [`config`](/cli/resource/config)     | Read and wire credentials, consts, schedules. |
| [`publish`](/cli/resource/publish)   | Validate and promote local files to live.     |

Type-specific tools live under [`geni workflow`](/cli/resource/workflow) and [`geni app`](/cli/resource/app). Each type's contract and worked example ship in its [authoring skill](/cli/skills/load).
