Argon Documentation

website·Indexed 32 days ago

https://argon.wiki/docs

Argon is a tool for Roblox development that enables the use of external editors, tools, and version control systems. It features a CLI and VS Code extension for project initialization, live syncing, and building. The platform supports various file types transformed into Roblox instances, provides Rojo compatibility, and includes support for TypeScript and automation.

Tokens
10.8K
Snippets
62
Records
108
Agent score
64%

What's inside Argon

  1. Overview of Argon for Roblox project management

    Argon is a tool designed for both professional users and beginners to manage small and large projects. It enables the integration of external editors, version control systems, and automated workflows into the development process.
  2. Overview of Argon professional features

    Argon is a tool built with Rust and MessagePack designed for Roblox development. It enables the use of external editors, tools, and version control systems. Key characteristics include:

    • Modular Integration: Works with other Roblox tools such as Wally, StyLua, selene, and roblox-ts.
    • Customization: Supports configuration via command flags, global config files, and project templates.
    • Ease of Use: Provides a VS Code extension with a graphical interface for one-click setup.
    • Safety: Major changes require user confirmation to prevent accidental data loss.
  3. Migrate a Rojo project to Argon

    Argon is compatible with Rojo projects. To migrate, move the placeId field into the placeIds array. The following field names are interchangeable between Rojo and Argon:
    serveAddress    ==> host
    servePort       ==> port
    servePlaceIds   ==> placeIds
    globIgnorePaths ==> ignoreGlobs
    emitLegacyScripts ==> legacyScripts
  4. Convert TOML files to ModuleScripts

    Files with the .toml extension are converted into ModuleScript instances returning a Luau table. TOML is recommended for human-readable configuration files. Note: DateTime values are converted to strings as Luau lacks a native representation for this type.
    string = "abc"
    bool = true
    array = [1, 2, 3]
    
    [object]
    int = 1337

    // Resulting ModuleScript Source:

    return {
    	["string"] = "abc",
    	["bool"] = true,
    	["array"] = {1, 2, 3},
    	["object"] = {
    		["int"] = 1337,
    	}
    }
  5. Convert JSON files to ModuleScripts

    Any file with the .json extension (that is not a .model.json, .project.json, or .meta.json) is converted into a ModuleScript. The script returns a Luau table representing the JSON structure. This is recommended for storing bulk data like asset IDs.
    {
      "string": "abc",
      "bool": true,
      "array": [1, 2, 3]
    }

    // Resulting ModuleScript Source:

    return {
    	["string"] = "abc",
    	["bool"] = true,
    	["array"] = {1, 2, 3},
    }
  6. Automate Argon builds and releases using GitHub Actions

    Argon's CLI can be integrated into CI/CD pipelines for automated building and deployment. The following example demonstrates a GitHub Action workflow that triggers on a tag push to create a draft release, install dependencies via Wally, build the plugin using argon build, and upload the resulting .rbxm file to GitHub artifacts and the release.
    name: Build and Release
    
    on:
      push:
        tags: ["*"]
    
    jobs:
      # Create a draft release on GitHub
      draft-release:
        name: Draft Release
        runs-on: ubuntu-latest
    
        outputs:
          upload_url: ${{ steps.create-release.outputs.upload_url }}
          release_id: ${{ steps.create-release.outputs.id }}
    
        steps:
          - uses: actions/checkout@v4
    
          - name: Create Release
            id: create-release
            uses: shogo82148/actions-create-release@v1
            with:
              release_name: ${{ github.ref_name }}
              draft: true
    
      # Build the plugin and upload it to GitHub
      build:
        name: Build
        runs-on: ubuntu-latest
        needs: draft-release
    
        steps:
          - uses: actions/checkout@v4
    
            # Setup Aftman that installs Argon and Wally
          - name: Setup Aftman
            uses: ok-nick/setup-aftman
    
            # Install Wally dependencies that our plugin uses
          - name: Install dependencies
            run: wally install
    
            # Build the plugin
          - name: Build
            run: argon build -vvvv
    
            # Upload the plugin to GitHub artifacts
          - name: Upload to Artifacts
            uses: actions/upload-artifact@v4
            with:
              name: plugin.rbxm
              path: plugin.rbxm
    
            # Upload the plugin to the draft release
          - name: Upload to Release
            uses: shogo82148/actions-upload-release-asset@v1
            with:
              upload_url: ${{ needs.draft-release.outputs.upload_url }}
              asset_name: plugin.rbxm
              asset_path: plugin.rbxm
    
      # Publish the release
      publish-release:
        name: Publish Release
        runs-on: ubuntu-latest
        needs: [build, draft-release]
    
        steps:
          - uses: eregon/publish-release@v1
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
            with:
              release_id: ${{ needs.draft-release.outputs.release_id }}
  7. Port an existing Roblox game to Argon

    To port a Roblox game to Argon, follow these steps:

    1. Create an empty Argon project.
    2. Ensure your *.project.json file includes all services you intend to port.
    3. Open the target place in Roblox Studio.
    4. In the Argon plugin settings, set the 'Initial Sync Priority' to Client.
    5. Start Live Sync in the Argon project.
    6. Connect the plugin to the active Argon session.
    7. If using the CLI, accept the incoming changes from Roblox Studio.
  8. Create Roblox instances with children using folders

    To create a Roblox instance that contains children, create a folder with the desired instance name and place an init file inside it. The suffix of the init file determines the type of the instance.

    Constraints:

    • Only one init file and one init.meta file are permitted per folder.
    • Exceptions: Project files ignore immediate children, and Data File (*.meta.json) is used specifically to describe an instance rather than acting as a container.
  9. Build projects into Roblox binary or XML files

    Argon can export projects into Roblox binary formats (.rbxl, .rbxm) or XML formats (.rbxlx, .rbxmx). This is used for creating plugins/models, sharing projects, or publishing to Roblox. To perform a build, run the Argon Build command via the CLI or VS Code.
  10. Update Argon CLI and Plugin

    Argon generally updates automatically. The CLI checks for updates on every run, and the plugin updates automatically unless specific configuration settings (check_updates or install_plugin) are disabled. Note that if Argon was installed via a toolchain manager (e.g., Aftman, Rokit) or Cargo, automatic updates are disabled and must be handled by that manager.
    argon update
  11. Convert YAML files to ModuleScripts

    Files with .yaml or .yml extensions are converted into ModuleScript instances returning a Luau table. Warning: Mappings only support string, number, and boolean keys; other key types will be skipped.
    string: abc
    bool: true
    array:
      - 1
      - 2

    // Resulting ModuleScript Source:

    return {
    	["string"] = "abc",
    	["bool"] = true,
    	["array"] = {1, 2},
    }
  12. Update Argon via VS Code Extension

    The VS Code extension updates automatically by default. To trigger a manual update through the extension interface, use the Command Palette to access the Argon menu.
    1. Press Ctrl/⌘ + Shift + P.
    2. Select Argon: Open Menu.
    3. Run the Update command.