Skip to content

ARX Commands

arx-cli provides a range of commands to preview, benchmark, migrate, and manage components and endpoints directly from a local repository. Here’s a breakdown of available commands:

Commands Overview

1 . Login

  • login: command in arx-cli is used to authenticate the user with Aurora Copilot, allowing access to restricted components or endpoints. This command initiates a login session, enabling users to interact with secured sections of the repository.

    Terminal window
    arx login

2. Prompts Extract

  • prompts:extract: command in arx-cli is used to extract Java/Spring Boot service context for workflow prompt generation. It scans the target project, extracts service structure, dependencies, and configuration, and outputs a context.yaml file.

    Terminal window
    arx prompts:extract [target] [--fresh]

3. Prompts Generate

  • prompts:generate: command in arx-cli is used to generate a workflow prompt from a context.yaml file. It reads the extracted context and generates a detailed prompt tailored to the specified workflow type.

    Terminal window
    arx prompts:generate [target] [--type <type>]

    Options:

    OptionDescription
    --type documentationGenerate documentation prompt
    --type serviceGenerate service prompt
    --type testsGenerate tests prompt

4. Debug

  • debug: command in arx-cli is used to aggregate error context and generate a fix plan for Cascade (AI assistant). It can fetch context from a Jira ticket, read a local crash log, or start a dev server to capture errors.

    Terminal window
    arx debug [options]

5. Component Preview

  • preview:component: command in arx-cli allows you to preview a specific component directly in the browser. This feature is particularly useful for inspecting, debugging, and verifying component structures.

    Terminal window
    arx preview:component

6. Endpoint Preview

  • preview:endpoint: command in arx-cli allows you to preview a specific endpoint directly in the browser. This feature is particularly useful for inspecting, debugging, and verifying endpoint structures.

    Terminal window
    arx preview:endpoint

7. Handlebars Preview

  • preview:hbs: command in arx-cli lets you preview a specified Handlebars (.hbs) template file directly in the browser. This is helpful for inspecting template structures and rendered output without setting up a server.

    Terminal window
    arx preview:hbs

8. Migrate

  • migrate command in arx-cli is used to upload local .ftl files to Aurora Copilot to facilitate migration of Node.js code. This command initiates a migration session, creates a session in Aurora Copilot, and redirects the user to the session in their browser.

    Terminal window
    arx migrate

9. Benchmarking

  • benchmark:endpoint: Runs a benchmark test on a specified endpoint, measuring response time and efficiency.

    Terminal window
    arx benchmark:endpoint

Test Driven Development (TDD)

  1. Write Tests First: Create test cases before implementing the actual code.
  2. Red-Green-Refactor Cycle:
    • Red: Write a failing test
    • Green: Implement code to pass the test
    • Refactor: Improve the code while keeping tests passing
  3. Incremental Development: Build features in small, testable increments.
  4. Continuous Verification: Regularly run tests to catch issues early.
  5. Design Evolution: Let tests guide the design of your codebase.

Benefits of TDD

  • βœ… Improved Code Quality: Fewer bugs and more modular code
  • πŸ›‘οΈ Reduced Risk: Tests act as a safety net for code changes
  • 🀝 Enhanced Collaboration: Clearer expectations and easier onboarding
  • ⚑ Quick Feedback: Immediate insights into code functionality
  • πŸ“š Living Documentation: Tests serve as up-to-date documentation

TDD Workflow

  1. Add a Test
  2. Run Tests (expect failure)
  3. Write Minimal Code
  4. Run Tests (expect success)
  5. Refactor
  6. Repeat

TDD with ARX commands, can create robust, well-tested components and endpoints efficiently.

10. Generate Test Cases

  • generate:test-cases: Generates test cases for a specified component or endpoint.

    Terminal window
    arx generate:test

11. Get Test Results

  • get:test-results: Retrieves test results for a specified component or endpoint.

    Terminal window
    arx run:test