Using AgentCraft

Log into Claude CLI

As AgentCraft uses your Claude Pro or Max subscription, first, you need to log into Claude CLI.

  • Open a terminal in the project folder and start Claude CLI with
claude
  • In the Claude CLI enter
/login

Follow the instructions to authorize Claude CLI to use your Anthropic subscription and paste the token from the browser window into the CLI.

Run AgentCraft

  • In a terminal navigate to the project folder
  • Execute the command
npx @idosal/agentcraft

The AgentCraft UI opens in your default web browser

Approving actions

If Manual approval is selected in the lower right corner (the button is hidden behind the thick fancy border), AgentCraft will ask for approval.

To approve the action

  • In the Claude CLI press enter to move the process forward
  • Claude CLI will ask for permission and execute the command of AgentCraft

Installing Claude AI

Install the Claude CLI

In a terminal execute

irm https://claude.ai/install.ps1 | iex

The Claude Code installation will check your system path environment variable, and if missing it will ask you to add the following to it:

C:\Users\YOUR_USER_NAME.local\bin

Start Claude CLI

  • Open a terminal in the project folder
  • Execute
claude

Configure Claude AI

  • Select the look in the terminal light/dark mode
  • Select Claude account with subscription. You need at least the Pro subscription to use Claude Code.
  • The Claude authorization page opens in your default web browser.
  • Claude CLI displays the message
    Login successful. Press Enter to continue…

Installing AgentCraft

AgentCraft is an AI Orchestrator with Real Time Strategy Game user interface.

It uses Claude Code CLI to access your Pro or Max Claude agent subscription. It does not need to know any tokens or credentials. To use AgentCraft, first, you need start Claude CLI and uses its infrastructure to connect to Claude Code.

Install Claude Code CLI

See Installing Claude AI

Install Node.js

AgentCraft is a Node.js package it requires Node.js version 18 or higher from https://nodejs.org/en/download

Run AgentCraft

To run AgentCraft directly from the NPM registry, execute the command in a terminal. This will always run the latest available version without a need for update.

npx @idosal/agentcraft

This is an NPM package for running AI agents in your project folder. It allows them to interact with your local files in that location. The user interface opens in a your default web browser.

Advanced use cases

To start AgentCraft in the background

npx @idosal/agentcraft start -d

To stop the server in the background

npx @idosal/agentcraft stop

Cannot connect to local MSSQL Server from Node.js

The default MSSQL server installation only enables the Shared Memory network protocol for connection.

Node.js can only connect using TCP/IP protocol. The error message is

Failed to connect to localhost/…. Error: Failed to connect to localhost:1433 – Could not connect (sequence) Failed to connect to localhost:1433 – Could not connect (sequence) ConnectionError: Failed to connect to localhost:1433 – Could not connect (sequence)

Enable the TCP/IP protocol

To be able to connect to a local MSSQL Server from a Node.js application, we need to enable the TCP/IP protocol.

  • Open the SQL Server Configuration Manager as administrator
    Right-click the SQL Server Configuration Manager item in the start menu, select More, and click the Run as administrator option
  • In the SQL Server Network Configuration select Protocols for MSSQL SERVER, and double-click the TCP/IP option. Set the Enabled value to Yes
  • The dialog box reminds us to restart the MSSQL Server for the change to take effect

Restart the MSSQL Server

  • On the left side select SQL Server Services, right-click MSSQL Server and select Restart

GitHub Copilot Configuration settings

You may apply these configuration settings to enable useful features. Always read the documentation to see if these are safe and beneficial to you.

Copilot Memory

You can use Copilot Memory to remember repository context across Copilot agent interactions.

To store a memory start the prompt with “Remember: …”

More information on GitHub Copilot memories are at https://docs.github.com/en/copilot/how-tos/use-copilot-agents/copilot-memory

Generic memories for all projects

To store generic instructions, prompt:
Remember: Never make assumptions, if in doubt, ask clarifying questions

Project level memories

Memories are concise, actionable facts than Copilot agents will retain across sessions. To enable project level memories and allow agents to automatically save new discoveries in the .github/copilot-memory.md file prompt:
Create the memory file for agents

Project level instructions

To generate instructions for agents to avoid the repeated discovery of the entire project, we will create the .github/copilot-instructions.md file:

  • On the top of the chat window click the gear icon
  • Select Instructions & Rules
  • On the top of the screen select Generate agent instructions

Checkpoint file changes

chat.checkpoints.showFileChanges set to ON

Explain button

chat.editing.explainChanges.enabled set to ON

Inline Chat Enable V2

If you want to experiment with the new inline chat feature enable

inlineChat.enableV2

Usage suggestions

Hide Sessions

When the chat window is wide enough it displays the list of prior sessions. It is useful, but prevents us to widen the chat window for better reading experience. We can disable this behavior using the chat.viewSessions.enabled setting, or close the prior sessions with the Hide Agent Sessions Sidebar button

Kerbal Space Program 1 vs. 2

The development of Kerbal Space Program 2 was terminated prematurely, just at the time when the major bugs were removed, but before the application would provide significant benefits over version 1.

With mods, Kerbal Space Program 1 can provide the same visual quality with less bugs and better performance. As the development of version 1 was completed at a planned state, the application is stable, and will not change anymore. This simplifies the work of modders, who otherwise would need to constantly update their mods to keep up with the changes in the application code. This provides the ideal platform for the modding community to freely enhance the game for the benefit of everyone.

Visual Quality Improvements

Users recommend the following mods to improve visual quality

  • Scatterer (Kabrams Diamond Sunflare or any other mod available)
  • Parralax
  • EVE (Or if you’re willing to pay, Blackrack’s Volumetric Clouds)
  • PlanetShine
  • Firefly
  • Astronomer’s Visual Pack
  • Better Kerbol
  • ASET Props and Avionics packs
  • Textures Unlimited
  • TextureReplacer
  • Waterfall
  • WindowShine
  • ShineFix
  • TUFX

Determine the Azure Container App memory usage

To determine how much memory the Azure Container App needs, we can use the Metrics feature. To monitor the resource usage

  • Log into the Azure Portal at https://portal.azure.com
  • Open the Container Apps page, and select the application
  • On left in the Monitoring menu select Metrics
  • Click the Add metric button and select the Memory Working Set Bytes and Max value

Pass environment variables to Azure Container Apps

To pass secrets, configuration values to Azure Container Apps we can use the Azure CLI or the Azure Portal.

To pass an environment variable value to toe Azure Container App using the Azure CLI execute the command in a terminal

az containerapp update --name <app-name> --resource-group <rg> \
  --set-env-vars NODE_OPTIONS="--max-old-space-size=4096"

To use the Azure Portal web interface

  • Log into the Azure Portal at https://portal.azure.com
  • On the Container Apps page select the application
  • In the Application, Containers, page open the Environment variables tab and add a new environment variable. Click the Save as a new revision button

Deploy the new version of the application in Azure Container Apps

Azure Container Apps (ACA) run containers in a serverless environment with zero environment maintenance requirement. To deploy a new application in Azure Container Apps follow the steps at Deploy a web application in Azure Container Apps (ACA)

To deploy a new version of the same app in Azure Container Apps

  • Log in to the Azure Portal at https://portal.azure.com
  • In the top search bar search for container apps and select Container Apps in the list
  • In the application list click the name of the application
  • In the Application menu select Revisions and Replicas
  • Click the Create new revision button
  • Select a prior revision as a base configuration, enter a name for the new provision, and select the container image. Click the Next: Scale button
  • If you always want to have at least one replica running for immediate availability, select 1 for Min replicas. If volumes are needed for the app, click the Next: Volumes button, otherwise click the Create button
  • Click the Notifications button to monitor the progress

Push a Docker container image to the Azure Container Registry

To push a Docker container image to the Azure Container Registry

Build the Docker container image

  • Navigate to https://www.docker.com/ and create a free Docker Hub account
  • Install the Docker Desktop application
  • Start the Docker Desktop application
  • Open a terminal and navigate to the application root directory where the Dockerfile is located
  • In the terminal execute the command
    docker build -t MY_IMAGE .
  • Push the image to the registry
	az login
	az acr login --name MY_REGISTRY
	docker tag MY_IMAGE:latest MY_REGISTRY.azurecr.io/MY_REPOSITORY/MY_IMAGE:latest
	docker push MY_REGISTRY.azurecr.io/MY_REPOSITORY/MY_IMAGE:latest

Troubleshooting

Error message when building the image

docker build -t …:latest .
ERROR: error during connect: Head “http://%2F%2F.%2Fpipe%2FdockerDesktopLinuxEngine/_ping”: open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.

Solution

Start the Docker Desktop application

Error message when pushing the image to Azure Container Registry

error from registry: authentication required, visit https://aka.ms/acr/authorization for more information. CorrelationId: 2a33d0ac-091c-4158-b927-397c6e5692cf

Solution