Skip to content

scaffold

Description

Commands for scaffolding new components.

Available Commands: contract: Scaffold a smart contract component fsm: Scaffold a Finite State Machine (FSM) protocol: Scaffold a protocol component connection: Scaffold a connection component handler: Generate an AEA handler from OpenAPI 3 specification

Usage

adev scaffold [OPTIONS] [ARGS]

Additionally, you can view the parameters for the command using:

adev scaffold --help

Behaviour

Generate an AEA handler from an OpenAPI 3 specification.

Example:

adev scaffold behaviour openapi.yaml --behaviour-type metrics

Connection

Scaffold a new connection component.

Required Parameters: name: Name of the connection to create. protocol: Public ID of the protocol to use (author/name format).

Usage: Create connection with protocol: adev scaffold connection my_connection --protocol author/protocol_name

Create connection in specific directory:
    cd my_project
    adev scaffold connection my_connection --protocol author/protocol_name

Contract

Scaffold a smart contract component.

Required Parameters: Either one of: public_id: The public ID of the contract (author/name format). from_file: Path to file containing contract addresses and names.

Optional Parameters: address: Contract address on the blockchain. Default: null address from_abi: Path to ABI file to use for scaffolding. Default: None network: Blockchain network to fetch ABI from. Default: ethereum read_functions: Comma-separated list of read functions to include. Default: None (all) write_functions: Comma-separated list of write functions to include. Default: None (all)

Usage: Scaffold from address: adev scaffold contract author/contract_name --address 0x123...

Scaffold from ABI file:
    adev scaffold contract author/contract_name --from-abi ./contract.abi

Scaffold from file with multiple contracts:
    adev scaffold contract --from-file ./contracts.yaml

Scaffold with specific network:
    adev scaffold contract author/contract_name --address 0x123... --network polygon

Scaffold with specific functions:
    adev scaffold contract author/contract_name --address 0x123... --read-functions "balanceOf,totalSupply"

Dao

Scaffold Data Access Objects (DAOs) and generate test script based on an OpenAPI 3 specification.

Dialogues

Generate an AEA handler from an OpenAPI 3 specification.

Example:

adev scaffold behaviour openapi.yaml --behaviour-type metrics

Fsm

Scaffold a new Finite State Machine (FSM).

Optional Parameters: spec: Path to FSM specification YAML file. Default: None

Usage: Scaffold base FSM: adev scaffold fsm

Scaffold from specification:
    adev scaffold fsm --spec fsm_specification.yaml

Notes

- Requires aea_config.yaml in current directory
- Automatically adds required base FSM skills:
    - abstract_abci
    - abstract_round_abci
    - registration_abci
    - reset_pause_abci
    - termination_abci
- When using spec file:
    - Must be valid FSM specification in YAML format
    - FSM label must end with 'App' suffix
    - Creates FSM based on specification structure

Handler

Generate an AEA handler from an OpenAPI 3 specification.

Required Parameters: spec_file: Path to OpenAPI 3 specification file public_id: Public ID for the handler (author/name format)

Optional Parameters: new_skill: Create a new skill for the handler. Default: False auto_confirm: Skip confirmation prompts. Default: False

Usage: Basic handler generation: adev scaffold handler api_spec.yaml author/handler_name

Create new skill:
    adev scaffold handler api_spec.yaml author/handler_name --new-skill

Skip confirmations:
    adev scaffold handler api_spec.yaml author/handler_name --auto-confirm

Notes

- Requires aea_config.yaml in current directory
- Generates handler code from OpenAPI endpoints
- Creates necessary message classes
- Can optionally create a new skill
- Shows changes and prompts for confirmation

Handlers

Generate an AEA handler from an OpenAPI 3 specification.

Example:

adev scaffold behaviour openapi.yaml --behaviour-type metrics

Protocol

Scaffold a new protocol component.

Required Parameters: protocol_specification_path: Path to protocol specification file

Optional Parameters: language: Programming language for protocol (default: python)

Usage: Basic protocol scaffolding: adev scaffold protocol path/to/spec.yaml

Specify language:
    adev scaffold protocol path/to/spec.yaml --l python

Notes

- Creates protocol package from specification
- Supports multiple programming languages
- Generates message classes and serialization
- Adds protocol to agent configuration

Tests

Generate tests for an aea component in the current directory AEA handler from an OpenAPI 3 specification.