Skip to content

armgit / ax

Public Imported from GitHub
0

Agent Executor (AX) is Google's open agentic orchestration runtime

Go

Rename cli config flags to --agent-config and --agent-config-file

Jaana Dogan087df171b3f3
diff --git a/README.md b/README.md
index 581f703..375f689 100644
--- a/README.md
+++ b/README.md
@@ -171,18 +171,18 @@ ax \
[--input <text>] \
[--conversation <id>] \
[--agent <id>] \
- [--config <json>] \
- [--config-file <file.json>] \
+ [--agent-config <json>] \
+ [--agent-config-file <file.json>] \
[--server <address>] \
- [--ax-config <file>] \
+ [--config <file>] \
[--resume]
```
Options:
- `--agent`: Agent ID (optional, default agent is used if not specified)
-- `--ax-config`: Path to YAML configuration file (only used with a local built-in AX server) (default "ax.yaml")
-- `--config`: Per-request agent configuration as an inline JSON string (mutually exclusive with `--config-file`)
-- `--config-file`: Path to a JSON file with per-request agent configuration
+- `--agent-config`: Per-request agent configuration as an inline JSON string (mutually exclusive with `--agent-config-file`)
+- `--agent-config-file`: Path to a JSON file with per-request agent configuration
+- `--config`: Path to YAML configuration file (only used with a local built-in AX server) (default "ax.yaml")
- `--conversation`: Conversation ID (optional, generates UUID if not provided)
- `--input`: Input message to send (optional)
- `--resume`: Resume a conversation without inputs
@@ -200,12 +200,12 @@ ax --conversation a53d4db3-1165-4925-87da-be6c72bbdeb1 --input "Ok, now let's do
# Execute using server mode
ax --server localhost:8494 --input "Hello agents!"
-# Execute with per-request harness config
-ax --config '{"system_instructions":"Answer in one sentence.","model":"gemini-3.5-flash"}' \
+# Execute with per-request agent config
+ax --agent-config '{"system_instructions":"Answer in one sentence.","model":"gemini-3.5-flash"}' \
--input "Explain durable execution."
-# To keep the same JSON in a file, use `--config-file` instead:
-ax --config-file antigravity.json --input "Explain durable execution."
+# To keep the same JSON in a file, use `--agent-config-file` instead:
+ax --agent-config-file antigravity.json --input "Explain durable execution."
```
### Serve
diff --git a/ax.yaml b/ax.yaml
index 0add0be..41b2104 100644
--- a/ax.yaml
+++ b/ax.yaml
@@ -13,8 +13,8 @@
# limitations under the License.
# Sample LOCAL configuration for the AX *harness* build (compiled with -tags=harness).
-# Usage: ax serve --ax-config ax.yaml
-# ax --ax-config ax.yaml --input "hello" # uses default harness (antigravity)
+# Usage: ax serve --config ax.yaml
+# ax --config ax.yaml --input "hello" # uses default harness (antigravity)
version: v1alpha
server:
diff --git a/cmd/ax/exec.go b/cmd/ax/exec.go
index 8fa0b90..367d8c4 100644
--- a/cmd/ax/exec.go
+++ b/cmd/ax/exec.go
@@ -34,14 +34,14 @@ import (
)
var (
- execConversationID string
- execAgentID string
- execConfigFile string
- execConfig string
- execInput string
- execServerAddr string
- execAXConfigFile string
- execResume bool // allow resuming an execution without inputs
+ execConversationID string
+ execAgentID string
+ execAgentConfigFile string
+ execAgentConfig string
+ execInput string
+ execServerAddr string
+ execConfigFile string
+ execResume bool // allow resuming an execution without inputs
)
var execCmd = &cobra.Command{
@@ -56,14 +56,14 @@ If no conversation ID is provided, a new UUID will be generated.`,
func registerExecFlags(cmd *cobra.Command) {
cmd.Flags().StringVar(&execConversationID, "conversation", "", "Conversation ID (optional, generates UUID if not provided)")
cmd.Flags().StringVar(&execAgentID, "agent", "", "Agent ID (optional, default agent is used if not specified)")
- cmd.Flags().StringVar(&execConfigFile, "config-file", "", "Path to a JSON file with per-request agent configuration")
- cmd.Flags().StringVar(&execConfig, "config", "", "Per-request agent configuration as an inline JSON string (mutually exclusive with --config-file)")
+ cmd.Flags().StringVar(&execAgentConfigFile, "agent-config-file", "", "Path to a JSON file with per-request agent configuration")
+ cmd.Flags().StringVar(&execAgentConfig, "agent-config", "", "Per-request agent configuration as an inline JSON string (mutually exclusive with --agent-config-file)")
cmd.Flags().StringVar(&execInput, "input", "", "Input message to send (optional)")
cmd.Flags().StringVar(&execServerAddr, "server", "", "gRPC controller server address (if specified, connects to remote server; otherwise runs with a local built-in AX server)")
- cmd.Flags().StringVar(&execAXConfigFile, "ax-config", "ax.yaml", "Path to YAML configuration file (only used with a local built-in AX server)")
+ cmd.Flags().StringVar(&execConfigFile, "config", "ax.yaml", "Path to YAML configuration file (only used with a local built-in AX server)")
cmd.Flags().BoolVar(&execResume, "resume", false, "Resume a conversation without inputs")
cmd.MarkFlagsMutuallyExclusive("input", "resume")
- cmd.MarkFlagsMutuallyExclusive("config", "config-file")
+ cmd.MarkFlagsMutuallyExclusive("agent-config", "agent-config-file")
}
func init() {
@@ -110,7 +110,7 @@ func runExec(cmd *cobra.Command, args []string) error {
}()
if execServerAddr == "" {
- cfg, err := newConfig(cmd, execAXConfigFile)
+ cfg, err := newConfig(cmd, execConfigFile)
if err != nil {
return err
}
@@ -126,14 +126,14 @@ func runExec(cmd *cobra.Command, args []string) error {
}
var agentConfig []byte
- if execConfigFile != "" {
- b, err := os.ReadFile(execConfigFile)
+ if execAgentConfigFile != "" {
+ b, err := os.ReadFile(execAgentConfigFile)
if err != nil {
- return fmt.Errorf("failed to read agent config %q: %w", execConfigFile, err)
+ return fmt.Errorf("failed to read agent config %q: %w", execAgentConfigFile, err)
}
agentConfig = b
- } else if execConfig != "" {
- agentConfig = []byte(execConfig)
+ } else if execAgentConfig != "" {
+ agentConfig = []byte(execAgentConfig)
}
return execLoop(ctx, execConversationID, execAgentID, agentConfig, execInput)
diff --git a/cmd/ax/main.go b/cmd/ax/main.go
index e0f36ba..bee13db 100644
--- a/cmd/ax/main.go
+++ b/cmd/ax/main.go
@@ -65,8 +65,8 @@ const currentVersion = "v1alpha"
func newConfig(cmd *cobra.Command, configFile string) (*cliutil.Config, error) {
cfg, err := cliutil.LoadFromFile(configFile)
- configFlagChanged := (cmd.Flags().Lookup("ax-config") != nil && cmd.Flags().Changed("ax-config")) ||
- (cmd.Flags().Lookup("config-file") != nil && cmd.Flags().Changed("config-file"))
+ configFlagChanged := (cmd.Flags().Lookup("config") != nil && cmd.Flags().Changed("config")) ||
+ (cmd.Flags().Lookup("agent-config-file") != nil && cmd.Flags().Changed("agent-config-file"))
if errors.Is(err, os.ErrNotExist) && !configFlagChanged {
cfg := cliutil.DefaultConfig()
cfg.Version = currentVersion