Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.argalabs.com/llms.txt

Use this file to discover all available pages before exploring further.

Create a scenario

Create with a natural language prompt. Arga generates the seed config.
const scenario = await client.scenarios.create({
  name: 'E-commerce checkout',
  prompt: 'A Stripe account with 3 customers on different plans',
  description: 'For testing checkout flows',  // optional
  tags: ['checkout', 'stripe'],               // optional
});
Or create with an explicit seed config:
const scenario = await client.scenarios.create({
  name: 'Support channel',
  twins: ['slack'],
  seedConfig: {
    slack: {
      channels: [{ name: 'support', messages: ['Help needed'] }],
    },
  },
});

List scenarios

// All scenarios
const scenarios = await client.scenarios.list();

// Filter by twin or tag
const stripeScenarios = await client.scenarios.list({ twin: 'stripe' });
const checkoutScenarios = await client.scenarios.list({ tag: 'checkout' });

Get a scenario

const scenario = await client.scenarios.get('scenario-id');
console.log(scenario.name, scenario.twins, scenario.seedConfig);

Ensure permanent scenario twin URLs

Create or return a long-lived twin environment pinned to a scenario. Each (scenario, twin) pair gets a stable baseUrl, so two different scenarios using the same twin receive different permanent URLs.
let env = await client.scenarios.ensureTwinEnvironment('scenario-id', {
  twins: ['stripe', 'slack'], // optional — defaults to the scenario's twins
  public: true,               // public base URLs are directly callable
});

if (env.status !== 'ready') {
  env = await client.scenarios.getTwinEnvironment('scenario-id');
}

for (const [name, twin] of Object.entries(env.twins)) {
  console.log(`${name}: ${twin.baseUrl}`);
  console.log(`  Admin: ${twin.adminUrl}`);
  console.log(`  Env vars:`, twin.envVars);
}
Reseed a ready environment from the scenario’s saved seed configuration:
env = await client.scenarios.reseedTwinEnvironment('scenario-id');
console.log(env.status, env.lastSeededAt);
Tear it down when you no longer need the stable URLs:
await client.scenarios.deleteTwinEnvironment('scenario-id');
List all long-lived scenario twin environments:
const envs = await client.scenarios.listTwinEnvironments();
client.twins.provision(...) still creates short-lived twin sessions with a TTL. Use scenario twin environments when you need URLs that survive across runs and can be reset with reseedTwinEnvironment(...).