snow ai opencode¶
Launches OpenCode with its Snowflake provider pointed at Cortex AI Gateway, using the endpoint and credential from the selected connection.
Syntax¶
Arguments¶
None
Options¶
--gateway-name TEXTName of the AI Gateway to route requests through. The host always comes from the connection. Default:
SNOWFLAKE.--agent-argsPasses everything after it to
opencodeunchanged. Must be the last Snowflake CLI option on the command line. See Passing arguments to the agent.--connection, -c, --environment TEXTName of the connection, as defined in your
config.tomlfile. Default:default.<connection_options>The standard Snowflake CLI connection options, such as
--account,--user,--role,--authenticator,--token, and--token-file-path, which override the values in the connection. See Managing Snowflake connections. The connection must use a supported authenticator. See Authentication.
--helpDisplays the help text for this command.
Usage notes¶
-
OpenCode must already be installed. See How `snow ai` works.
-
snow ai opencodepasses its configuration in theOPENCODE_CONFIG_CONTENTenvironment variable, which OpenCode merges on top of your global and project configuration for that process only. The configuration it passes is equivalent to:Where:
accountis the gateway host. OpenCode’ssnowflake-cortexprovider needs it to apply its Snowflake request compatibility handling.small_modelis set to the same model asmodel, so OpenCode’s lightweight requests, such as session titles, also use a model the gateway serves.
Your organization’s managed OpenCode settings are applied after
OPENCODE_CONFIG_CONTENTand might override these values. -
OpenCode uses the Chat Completions API, which doesn’t serve Claude models. The default model is
openai-gpt-5.4. To choose another model, pass OpenCode’s own-moption with the provider name, for example--agent-args -m snowflake-cortex/<model>. -
When the connection uses
authenticator = oauth_authorization_code,apiKeyis set to a placeholder value instead of a token, and the configuration also loads a plugin bundled with Snowflake CLI. Before each model request, the plugin calls the Snowflake CLI token helper and sets theAuthorizationheader to a fresh access token. In this mode, you can’t pass OpenCode’s--pureor--attachoptions, or setOPENCODE_PURE, because they would skip the plugin. -
snow ai opencodedoesn’t add any telemetry plugin. Any OpenCode plugins or exporter settings in your own configuration still apply. -
snow ai opencoderefuses to launch whenSNOWFLAKE_CORTEX_TOKENorSNOWFLAKE_CORTEX_PATis set.
Examples¶
-
Start an interactive session with the default connection:
-
Use a specific connection:
-
Run a single task non-interactively:
-
Choose the model:
-
Start the OpenCode server: