### World.toml Project Configuration Example Source: https://context7.com/argus-labs/world-cli/llms.txt An example TOML file illustrating the configuration structure for a World Engine project. It defines settings for namespaces, project metadata, and optional service configurations for Docker, Cardinal, Redis, and EVM. ```toml # world.toml - Project configuration file [namespace] name = "my-game" [forge] PROJECT_NAME = "My Awesome Game" [docker] # Docker Compose service definitions # Cardinal, Redis, and optional EVM services [cardinal] # Cardinal-specific configuration # Network ports, environment variables, build flags [redis] # Redis configuration # Port, persistence settings [evm] # EVM blockchain configuration # Chain ID, gas settings, DA layer configuration ``` -------------------------------- ### CLI User Configuration Example Source: https://context7.com/argus-labs/world-cli/llms.txt An example TOML file showing the user-specific configuration for the World CLI, typically located at '~/.worldcli/config.toml'. It includes authentication credentials, current organization and project settings, repository information, and telemetry preferences. ```toml # ~/.worldcli/config.toml - CLI user configuration [credential] token = "ArgusID " [current] organization_id = "org-uuid" organization_name = "My Studio" organization_slug = "my-studio" project_id = "project-uuid" project_name = "My Game" project_slug = "my-game" [repo] # Automatically detected Git repository information url = "https://github.com/username/game-repo" path = "cardinal" [telemetry] # Telemetry settings (Posthog events, Sentry error tracking) enabled = true ``` -------------------------------- ### Deploy Project via API (Go) Source: https://context7.com/argus-labs/world-cli/llms.txt This Go code shows how to deploy a project using the World CLI API. It includes steps for previewing a deployment (dry-run) and then executing the actual deployment. It also demonstrates how to check the deployment's health status across different regions. Requires organization and project IDs. ```go package main import ( "context" "fmt" "pkg.world.dev/world-cli/internal/app/world-cli/clients/api" "pkg.world.dev/world-cli/internal/app/world-cli/models" ) func main() { client := api.NewClient("https://forge.world.dev", "https://rpc.world.dev", "https://id.argus.gg") client.SetAuthToken("your-token") ctx := context.Background() orgID := "org-uuid" projID := "project-uuid" // Preview deployment (dry-run) preview, err := client.PreviewDeployment(ctx, orgID, projID, "deploy") if err != nil { fmt.Printf("Error previewing deployment: %v\n", err) return } fmt.Printf("Deployment preview: %+v\n", preview) // Execute deployment err = client.DeployProject(ctx, orgID, projID, "deploy") if err != nil { fmt.Printf("Error deploying: %v\n", err) return } fmt.Println("Deployment initiated successfully") // Check deployment health health, err := client.GetDeploymentHealthStatus(ctx, projID) if err != nil { fmt.Printf("Error getting health: %v\n", err) return } for region, status := range health { fmt.Printf("Region %s: %s\n", region, status.Status) } } ``` -------------------------------- ### Create Project via API (Go) Source: https://context7.com/argus-labs/world-cli/llms.txt This Go code snippet demonstrates how to create a new project using the World CLI API. It requires authentication and provides project details such as name, repository URL, and configuration. The output includes the created project's ID and deploy secret. ```go package main import ( "context" "fmt" "pkg.world.dev/world-cli/internal/app/world-cli/clients/api" "pkg.world.dev/world-cli/internal/app/world-cli/models" ) func main() { client := api.NewClient("https://forge.world.dev", "https://rpc.world.dev", "https://id.argus.gg") client.SetAuthToken("your-token") ctx := context.Background() orgID := "org-uuid-here" project := models.Project{ Name: "My Game Project", Slug: "my-game", RepoURL: "https://github.com/username/game-repo", RepoToken: "ghp_token_here", RepoPath: "cardinal", OrgID: orgID, Config: models.ProjectConfig{ Region: []string{"us-west-2", "eu-central-1"}, Discord: models.ProjectConfigDiscord{ Enabled: true, Token: "discord-bot-token", Channel: "channel-id", }, Slack: models.ProjectConfigSlack{ Enabled: false, }, }, } createdProject, err := client.CreateProject(ctx, orgID, project) if err != nil { fmt.Printf("Error creating project: %v\n", err) return } fmt.Printf("Created project: %s (ID: %s)\n", createdProject.Name, createdProject.ID) fmt.Printf("Deploy Secret: %s\n", createdProject.DeploySecret) // Save deploy secret securely - it won't be shown again } ``` -------------------------------- ### Initialize World CLI API Client in Go Source: https://context7.com/argus-labs/world-cli/llms.txt Go code snippet demonstrating how to initialize the World CLI API client. It shows setting up the client with base, RPC, and Argus ID URLs, and authenticating with a token. ```go package main import ( "context" "time" "pkg.world.dev/world-cli/internal/app/world-cli/clients/api" ) func main() { // Create new API client baseURL := "https://forge.world.dev" rpcURL := "https://rpc.world.dev" argusIDURL := "https://id.argus.gg" client := api.NewClient(baseURL, rpcURL, argusIDURL) // Set authentication token token := "your-auth-token-here" client.SetAuthToken(token) ctx := context.Background() // Client ready for API calls } ``` -------------------------------- ### Create Project with World CLI Source: https://context7.com/argus-labs/world-cli/llms.txt Commands for creating a new project. Supports interactive creation or providing details via flags. Project creation requires a name, slug, repository URL, access token for private repos, repository path, and deployment regions. Optional Discord and Slack notification settings can also be configured. Returns a deploy secret upon successful creation. ```bash # Interactive project creation world project create # Create with flags world project create --name="My Awesome Game" --slug="awesome-game" # Project creation requires: # - Project name (max 50 characters) # - Unique slug (3-25 characters) # - Repository URL (GitHub/GitLab) # - Repository access token (for private repos) # - Repository path (path to Cardinal within repo) # - Deployment regions (us-west-2, eu-central-1, etc.) # - Optional: Discord notifications (bot token + channel ID) # - Optional: Slack notifications (token + channel ID) # Returns deploy secret (save immediately, shown only once) ``` -------------------------------- ### Promote Test to Live Environment with World CLI Source: https://context7.com/argus-labs/world-cli/llms.txt Command to promote a TEST environment deployment to the LIVE/production environment. This action requires confirmation and makes the current TEST deployment serve production traffic. ```bash # Promote TEST deployment to LIVE/production world promote # Promotes current TEST deployment to LIVE # LIVE environment serves production traffic # Confirmation required before promotion ``` -------------------------------- ### List Organizations and Projects (Go) Source: https://context7.com/argus-labs/world-cli/llms.txt This Go code snippet shows how to list all organizations associated with the authenticated user and then iterate through each organization to list its projects. It retrieves project details like name, slug, repository URL, and configured regions. Requires authentication. ```go package main import ( "context" "fmt" "pkg.world.dev/world-cli/internal/app/world-cli/clients/api" ) func main() { client := api.NewClient("https://forge.world.dev", "https://rpc.world.dev", "https://id.argus.gg") client.SetAuthToken("your-token") ctx := context.Background() // Get all organizations for current user orgs, err := client.GetOrganizations(ctx) if err != nil { fmt.Printf("Error getting organizations: %v\n", err) return } for _, org := range orgs { fmt.Printf("Organization: %s (Slug: %s, ID: %s)\n", org.Name, org.Slug, org.ID) // Get projects for this organization projects, err := client.GetProjects(ctx, org.ID) if err != nil { fmt.Printf(" Error getting projects: %v\n", err) continue } for _, proj := range projects { fmt.Printf(" Project: %s (Slug: %s)\n", proj.Name, proj.Slug) fmt.Printf(" Repo: %s\n", proj.RepoURL) fmt.Printf(" Regions: %v\n", proj.Config.Region) } } } ``` -------------------------------- ### Deploy to Test Environment with World CLI Source: https://context7.com/argus-labs/world-cli/llms.txt Command to deploy the current project to the TEST environment. Supports forcing deployment without validation. The process includes configuration validation, Docker image building and pushing, deployment to selected regions, networking configuration, health checks, and notifications. ```bash # Deploy current project to TEST environment world deploy # Force deployment (skip validation) world deploy --force # Deployment process: # 1. Validates project configuration # 2. Builds Cardinal Docker images # 3. Pushes images to registry # 4. Deploys to selected regions # 5. Configures networking and load balancing # 6. Runs health checks # 7. Sends notifications (if configured) ``` -------------------------------- ### Create Organization with World CLI Source: https://context7.com/argus-labs/world-cli/llms.txt Commands to create a new organization using the World CLI. Supports interactive creation or creation with specific flags for name and slug. Organization slugs must be 3-25 characters and URL-safe. ```bash # Interactive organization creation world organization create # Create with flags world organization create --name="My Game Studio" --slug="my-studio" # Organizations contain multiple projects # Slug must be 3-25 characters, URL-safe ``` -------------------------------- ### Tail Deployment Logs with World CLI Source: https://context7.com/argus-labs/world-cli/llms.txt Command to tail logs from either the TEST or LIVE environment in specific regions. Allows monitoring of deployment activity and troubleshooting. ```bash # Tail logs from TEST environment in us-west-2 world logs us-west-2 test # Tail logs from LIVE environment in eu-central-1 world logs eu-central-1 live # Available regions: # - us-west-2 # - us-east-1 # - eu-central-1 # - ap-southeast-1 # Available environments: # - test (default) # - live ``` -------------------------------- ### Switch Project with World CLI Source: https://context7.com/argus-labs/world-cli/llms.txt Commands to switch the active project in the World CLI configuration. Supports interactive switching or specifying the project slug. This updates the configuration to target cloud operations to the selected project. ```bash # Switch to different project world project switch # Switch with slug world project switch --slug="another-game" # Updates current project in config # Cloud operations will target this project ``` -------------------------------- ### Reset Deployment with World CLI Source: https://context7.com/argus-labs/world-cli/llms.txt Command to restart a deployment with a clean state. This action restarts all services and clears game state while preserving configuration, useful for testing clean-slate scenarios. ```bash # Restart deployment with clean state world reset # Resets deployment: # - Restarts all services # - Clears game state # - Preserves configuration # Use for testing clean-slate scenarios ``` -------------------------------- ### Update Project with World CLI Source: https://context7.com/argus-labs/world-cli/llms.txt Commands to update an existing project's configuration. Allows updating fields such as name, slug, repository URL, token, path, deployment regions, and notification settings. ```bash # Update project configuration world project update # Update specific fields world project update --name="New Game Name" world project update --slug="new-slug" world project update --avatar-url="https://example.com/avatar.png" # Can update: # - Name and slug # - Repository URL and token # - Repository path # - Deployment regions # - Notification settings (Discord/Slack) ``` -------------------------------- ### List Organization Members with World CLI Source: https://context7.com/argus-labs/world-cli/llms.txt Commands to list members of the current organization. Supports listing active members or including removed members. The output displays member emails, roles, and status. ```bash # List active members world organization members # Include removed members world organization members --include-removed # Shows member emails, roles, and status ``` -------------------------------- ### Switch Organization with World CLI Source: https://context7.com/argus-labs/world-cli/llms.txt Commands to switch the active organization in the World CLI configuration. Supports interactive switching or specifying the organization slug. This action updates the ~/.worldcli/config.toml file, affecting subsequent project operations. ```bash # Switch to different organization world organization switch # Switch with slug specified world organization switch --slug="another-studio" # Updates current organization in ~/.worldcli/config.toml # All subsequent project operations use this organization ``` -------------------------------- ### Delete Project with World CLI Source: https://context7.com/argus-labs/world-cli/llms.txt Command to delete a project. This is an interactive process that requires confirmation due to its destructive nature. Deleting a project removes its configuration and all associated deployment data permanently. ```bash # Delete project (interactive confirmation) world project delete # WARNING: This deletes: # - Project configuration # - All deployment data # - Cannot be undone ``` -------------------------------- ### Check Deployment Status with World CLI Source: https://context7.com/argus-labs/world-cli/llms.txt Command to view the status and health of deployments across different regions. Provides information on deployment state, health check results, service endpoints, resource usage, and last deployment time. ```bash # View deployment status and health world status # Shows for each region: # - Deployment state (deploying/running/error) # - Health check results # - Service endpoints # - Resource usage # - Last deployment time ``` -------------------------------- ### Destroy Deployment with World CLI Source: https://context7.com/argus-labs/world-cli/llms.txt Command to remove all deployed infrastructure, including containers, load balancers, networking configuration, and game state data. This action requires confirmation as it cannot be undone. ```bash # Remove all deployed infrastructure world destroy # WARNING: Destroys: # - All deployed containers # - Load balancers # - Networking configuration # - Game state data # Confirmation required, cannot be undone ``` -------------------------------- ### Handle API Errors with Retry Logic in Go Source: https://context7.com/argus-labs/world-cli/llms.txt Demonstrates how to use the World CLI API client in Go to handle potential API errors with built-in retry logic. The client automatically retries on network timeouts, specific server errors (500, 502, 503, 504), and rate limiting (429). It supports up to 5 retries with exponential backoff and jitter. Error handling includes specific checks for authentication and authorization failures. ```go package main import ( "context" "fmt" "time" "pkg.world.dev/world-cli/internal/app/world-cli/clients/api" ) func main() { // Create client with custom HTTP client configuration client := api.NewClient("https://forge.world.dev", "https://rpc.world.dev", "https://id.argus.gg") client.SetAuthToken("your-token") // Client automatically retries on: // - Network timeouts // - 500, 502, 503, 504 errors // - 429 (rate limit) errors // Maximum 5 retries with exponential backoff // Base delay: 100ms, exponentially increases // Jitter added to prevent thundering herd ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() orgID := "org-uuid" projects, err := client.GetProjects(ctx, orgID) if err != nil { // Error handling switch { case err.Error() == "401 Unauthorized.": fmt.Println("Authentication failed - token invalid or expired") case err.Error() == "403 Forbidden.": fmt.Println("Access denied - insufficient permissions") default: fmt.Printf("Request failed after retries: %v\n", err) } return } fmt.Printf("Retrieved %d projects\n", len(projects)) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.