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. 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
3. 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
4. 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
5 . Migrate
-
migratecommand in arx-cli is used to upload local.ftlfiles 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
6 . 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)
- Write Tests First: Create test cases before implementing the actual code.
- Red-Green-Refactor Cycle:
- Red: Write a failing test
- Green: Implement code to pass the test
- Refactor: Improve the code while keeping tests passing
- Incremental Development: Build features in small, testable increments.
- Continuous Verification: Regularly run tests to catch issues early.
- 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
- Add a Test
- Run Tests (expect failure)
- Write Minimal Code
- Run Tests (expect success)
- Refactor
- Repeat
TDD with ARX commands, can create robust, well-tested components and endpoints efficiently.
7 . Generate Test Cases
-
generate:test-cases: Generates test cases for a specified component or endpoint.Terminal window arx generate:test
8 . Get Test Results
-
get:test-results: Retrieves test results for a specified component or endpoint.Terminal window arx run:test