Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/frontend/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export default defineConfig({
{ tag: 'link', attrs: { rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' } },
{ tag: 'meta', attrs: { name: 'apple-mobile-web-app-title', content: 'Aspire' } },
{ tag: 'link', attrs: { rel: 'alternate', type: 'application/rss+xml', title: 'Aspire Docs RSS', href: '/rss.xml' } },
{ tag: 'script', attrs: { src: '/os-tab-detector.js' } },
Comment thread
IEvangelist marked this conversation as resolved.
Outdated
{ tag: 'script', attrs: { src: 'https://js.monitor.azure.com/scripts/c/ms.analytics-web-3.min.js', defer: true } },
{ tag: 'script', attrs: { src: '/1ds/', defer: true } }
],
Expand Down
13 changes: 0 additions & 13 deletions src/frontend/package-lock.json
Comment thread
IEvangelist marked this conversation as resolved.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions src/frontend/public/os-tab-detector.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// OS Tab Detector
// This script detects the operating system and sets the default tab for terminal commands
// It should run early to avoid flash of incorrect content
(function() {
// Check if localStorage is available
if (typeof localStorage === 'undefined') return;

// Only set the default if the user hasn't already made a choice
const storageKey = 'starlight-synced-tabs__terminal';
const existingPreference = localStorage.getItem(storageKey);

// If user already has a preference, respect it
if (existingPreference) return;

// Detect OS - check platform first as it's more reliable, then fall back to userAgent
const platform = navigator.platform || '';
const userAgent = navigator.userAgent || '';

// Check for Windows in platform or userAgent
const isWindows = /^Win/i.test(platform) ||
/Win(dows|32|64)/i.test(userAgent);

// Set default tab based on OS
// Windows users get PowerShell, everyone else gets Bash
const defaultTab = isWindows ? 'PowerShell' : 'Bash';

localStorage.setItem(storageKey, defaultTab);
})();
35 changes: 15 additions & 20 deletions src/frontend/src/content/docs/get-started/install-cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Aspire provides a command-line interface (CLI) tool to help you create and manag
Before installing the Aspire CLI, ensure you have the [required prerequisites](/get-started/prerequisites/) set up.
</LearnMore>

## Install as a native executable
## Install the Aspire CLI

The Aspire CLI is installed using an installation script available for Bash and PowerShell.
You can install the Aspire CLI using an installation script (recommended) or as a .NET global tool.

<Aside type="note" title="Download and install" icon="download">
You can download and run the script in a single command, to install the Aspire CLI as a native executable:
You can download and run the installation script in a single command to install the Aspire CLI:

<Tabs syncKey="terminal">
<TabItem label="Bash" icon="seti:shell">
Expand All @@ -36,11 +36,23 @@ You can download and run the script in a single command, to install the Aspire C
code='irm https://aspire.dev/install.ps1 | iex'
/>
</TabItem>
<TabItem label=".NET CLI" icon="seti:json">
<Code
lang="bash"
code="dotnet tool install -g Aspire.Cli"
/>

<Aside type="tip" title="Alternative method" icon="information">
This installs the Aspire CLI as a [.NET global tool](https://www.nuget.org/packages/Aspire.CLI). We recommend using the native executable installation script (Bash or PowerShell) for the best experience.
</Aside>
</TabItem>
</Tabs>

The script installs the latest stable release of Aspire CLI. See [Validation](#validation) to verify the installation.
</Aside>

### Two-step installation process

Alternatively, you can download the script and run it as a two-step process:

<Steps>
Expand Down Expand Up @@ -90,23 +102,6 @@ Alternatively, you can download the script and run it as a two-step process:
</Tabs>
</Steps>

## Install as a .NET global tool

Use the `dotnet tool` command to install the Aspire CLI global tool. The name of the global tool is [`Aspire.Cli`](https://www.nuget.org/packages/Aspire.CLI).

<Steps>
01. Open a terminal.
01. Run the following command to install Aspire CLI:

```bash title=".NET CLI"
dotnet tool install -g Aspire.Cli
```

<Aside type="tip" title="Not recommended" icon="random">
Although the .NET global tool installation method is functional, we recommend using the native executable installation script for the best experience.
</Aside>
</Steps>

## Validation

To validate that the global tool is installed, use `aspire --version` to query Aspire CLI for a version number:
Comment thread
davidfowl marked this conversation as resolved.
Outdated
Expand Down
Loading