Skip to content

apify/kilocode-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apify for Kilo

Works with Kilo npm

@apify/kilocode-plugin gives Kilo Code agents one native tool — apify — that can run any of Apify's 20,000+ web-scraping and automation Actors and bring the results back into the conversation. Scrape Google Maps, Instagram, Amazon, TikTok, search the web, crawl a site, or invoke any Actor by slug — without a tool-per-site explosion.

Community integration. "Apify for Kilo" is built and maintained by Apify and is not officially affiliated with Kilo.

Install

Add a single line to your kilo.jsonc:

{
  "plugin": [
    ["@apify/kilocode-plugin", { "token": "{env:APIFY_TOKEN}" }]
  ]
}

Then set your token (get one at console.apify.com/account/integrations):

export APIFY_TOKEN="apify_api_..."

Or install via the CLI, which patches your config for you:

kilo plugin @apify/kilocode-plugin

Token sources

The plugin resolves the token in this order:

  1. Kilo auth UI — the plugin registers an "Apify API Token" auth method, so you can enter the key through Kilo's native auth flow.
  2. Config{ "token": "..." } (or { "apiKey": "..." }) in the kilo.jsonc plugin entry.
  3. EnvironmentAPIFY_API_KEY or APIFY_TOKEN.

If no token is found, the plugin registers no tool (the agent never sees a tool that would fail).

The apify tool

One tool, three actions. The agent composes them:

Action What it does
discover Search the Apify Store (query), or fetch an Actor's input schema + README (actorId).
start Launch an Actor run with a JSON input; returns run references immediately (non-blocking).
collect Poll the runs; return finished datasets, mark the rest pending, surface failures.

Typical flow: discover (search) → discover (schema) → startcollect (repeat collect while allDone is false).

Example (what the agent does under the hood)

// 1. Learn the Actor's inputs
{ "action": "discover", "actorId": "compass~crawler-google-places" }

// 2. Launch a run (batch many targets into ONE run when possible)
{ "action": "start",
  "actorId": "compass~crawler-google-places",
  "input": { "searchStringsArray": ["coffee shop Prague"], "maxCrawledPlacesPerSearch": 3 },
  "label": "prague-coffee" }

// 3. Collect — repeat until allDone: true
{ "action": "collect",
  "runs": [{ "runId": "", "actorId": "compass~crawler-google-places", "datasetId": "", "label": "prague-coffee" }] }

Slugs use a tilde: username~actor-name (e.g. apify~google-search-scraper), never a slash.

Safety

  • Prompt-injection defense. Scraped data is wrapped in <<<EXTERNAL_UNTRUSTED_CONTENT>>> markers (with the boundary markers sanitized out of the body) so a host that respects them won't treat scraped text as instructions.
  • Result-size cap. Dataset output is truncated to 50,000 characters to protect the context window.
  • SSRF guard. baseUrl must start with https://api.apify.com.
  • Secret hygiene. Tokens are newline-stripped before use and never echoed in tool output.

Configuration

Field Purpose
token / apiKey Apify API token. Falls back to APIFY_API_KEY / APIFY_TOKEN.
enabled Force on/off. When unset, the plugin enables itself iff a token is present.
baseUrl Override the Apify API origin. Must start with https://api.apify.com.
maxResults Default result cap (forward-looking; currently informational).
enabledTools Subset of tools to register (only apify exists today).

Development

npm install
npm run build       # tsc → dist/
npm run typecheck
npm test            # vitest, mocked apify-client

See CLAUDE.md for architecture notes and local end-to-end testing against a Kilo checkout.

License

Apache-2.0 © Apify

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors