Skip to main content

Command

Enum Command 

Source
pub enum Command {
    Init {
        name: String,
        dir: Option<PathBuf>,
    },
    Validate {
        path: PathBuf,
        max_size_mb: Option<u64>,
        no_color: bool,
    },
    RunExternal {
        env: Option<String>,
        token: Option<String>,
        bot_id: Option<String>,
    },
}

Variants§

§

Init

Scaffold a new bot project from the starter template.

Fields

§name: String

Project name (used as the directory name and Cargo.toml name).

§dir: Option<PathBuf>

Parent directory to create the project in (default: current dir).

§

Validate

Run pre-upload checks: size, file_structure, cargo_metadata, imports, bot_impl, decide_method.

Note: there is no --check-connectivity flag (cf. the Python and JavaScript SDKs). In Rust the protocol-conformance harness ships as a library function — chipzen_bot::run_conformance_checks — which runs 4 canned scenarios:

  • connectivity_full_match — handshake + 1 hand + match_end
  • multi_turn_request_id_echo — 3 turn_requests, request_id echo
  • action_rejected_recovery — safe-fallback retry on rejection
  • retry_storm_bounded — reactive response to 3 back-to-back action_rejected messages

Drive your bot through these from tests/conformance.rs and run via cargo test. The scaffolded starter at packages/rust/starters/rust/ includes a working template.

The validator is a courtesy linter — the authoritative gate is server-side seccomp + cap-drop on the bot container.

Fields

§path: PathBuf

Path to the bot project directory.

§max_size_mb: Option<u64>

Override max upload size in MB (default: 500).

§no_color: bool

Disable colored output.

§

RunExternal

Resolve + print the external-API remote-play connection (lobby URL, env, token presence) from chipzen.toml + flags, without connecting.

Unlike Python’s chipzen run-external my_bot.py, the Rust chipzen-sdk binary cannot dynamically load and run a bot from a file — a Rust bot is compiled into its own binary. So this subcommand is a config doctor: it does the same chipzen.toml discovery + env-aware URL resolution run_external_bot does and reports what it found, so you can verify your setup before wiring chipzen_bot::run_external_cli into your bot binary’s main (the scaffolded starter ships a run-external mode that calls it). The token is never printed.

Fields

§env: Option<String>

Target environment for the lobby URL. Defaults to $CHIPZEN_ENV if set, otherwise ‘prod’.

§token: Option<String>

External-API token (cz_extbot_…). Overrides [external_api].token in chipzen.toml. Only its presence is reported, never its value.

§bot_id: Option<String>

External-API bot UUID. Overrides [external_api].bot_id in chipzen.toml. Required when no [external_api].url is set.

Trait Implementations§

Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V