Skip to content

Commit 4cadbec

Browse files
committed
Update swiftly README for the 1.0.0 release
1 parent 7b773c7 commit 4cadbec

File tree

1 file changed

+33
-239
lines changed

1 file changed

+33
-239
lines changed

README.md

Lines changed: 33 additions & 239 deletions
Original file line numberDiff line numberDiff line change
@@ -1,266 +1,60 @@
11
# swiftly
22

3-
swiftly is a CLI tool for installing, managing, and switching between [Swift](https://www.swift.org/) toolchains, written in Swift. swiftly itself is designed to be extremely easy to install and get running, and its command interface is intended to be flexible while also being simple to use. The overall experience is inspired by and meant to feel reminiscent of the Rust toolchain manager [rustup](https://rustup.rs/).
3+
swiftly is a CLI tool for installing, managing, and switching between [Swift](https://www.swift.org/) toolchains, written in Swift. swiftly itself is designed to be extremely easy to install and get running, and its command interface is intended to be flexible while also being simple to use. You can use it with Linux and macOS.
44

5-
Ongoing maintenance and stewardship of this project is led by the [SSWG](https://www.swift.org/sswg/).
5+
### Installation and Basic Usage
66

7-
### Installation
7+
Install swiftly by going to the [Swift Install Page](https://swift.org/install) of swift.org and following the instructions there.
88

9-
Install swiftly using a script (hosted from this repository) using the command:
9+
Once swiftly is installed it will automatically install the latest released toolchain. You can use the familiar toolchain commands right away:
1010

1111
```
12-
curl -L https://swiftlang.github.io/swiftly/swiftly-install.sh | bash
13-
```
14-
15-
In the future, download the swiftly package from [swift.org](https://swift.org/download) and it can install itself with init:
16-
17-
```
18-
swiftly init
19-
```
20-
21-
### Basic usage
22-
23-
```
24-
$ swiftly install latest
25-
26-
Fetching the latest stable Swift release...
27-
Installing Swift 5.8.1
28-
Downloaded 488.5 MiB of 488.5 MiB
29-
Extracting toolchain...
30-
Swift 5.8.1 installed successfully!
31-
32-
$ swift --version
33-
34-
Swift version 5.8.1 (swift-5.8.1-RELEASE)
12+
swift --version
13+
--
14+
Swift version 6.0.3 (swift-6.0.3-RELEASE)
3515
Target: x86_64-unknown-linux-gnu
3616
```
3717

38-
## Features
39-
40-
- Installing multiple toolchains, including both stable releases and snapshots
41-
- Switching which installed toolchain is active (i.e. which one is discovered via `$PATH`)
42-
- Updating installed toolchains to the latest available versions of those toolchains
43-
- Uninstalling installed toolchains
44-
- Listing the toolchains that are available to install (not yet implemented)
45-
46-
## Platform support
47-
48-
- Linux-based platforms listed on https://swift.org/download
49-
50-
Right now, swiftly is in early stages of development and is supported on Linux and macOS. For more detailed information about swiftly's intended features and implementation, check out the [design document](DESIGN.md).
51-
52-
## Command interface overview
53-
54-
### Installing a toolchain
55-
56-
#### Install the latest version of Swift
57-
58-
```
59-
$ swiftly install latest
60-
```
61-
62-
#### Installing a specific release version of Swift
63-
64-
A specific version of Swift can be provided to the `install` command.
65-
66-
```
67-
$ swiftly install 5.6.1
68-
```
69-
70-
If a patch version isn't specified, swiftly will look up and install the latest patch version that matches the minor version provided:
71-
72-
```
73-
$ swiftly install 5.6
74-
```
75-
76-
#### Installing main development snapshots (trunk)
77-
78-
```
79-
$ swiftly install main-snapshot-2022-01-28
80-
```
81-
82-
If the date isn't specified, swiftly will look up and install the latest available snapshot:
83-
84-
```
85-
$ swiftly install main-snapshot
86-
```
87-
88-
#### Installing Swift version development snapshots
89-
9018
```
91-
$ swiftly install 5.7-snapshot-2022-08-30
19+
lldb
20+
--
21+
(lldb): _
9222
```
9323

94-
If the date isn't specified, swiftly will look up and install the latest snapshot associated with the provided development branch:
24+
Install another toolchain, such as the latest nightly snapshot of the main branch. Use it so that when you run a toolchain command it uses that one.
9525

9626
```
97-
$ swiftly install 5.7-snapshot
98-
```
99-
100-
### Uninstalling a toolchain
101-
102-
#### Uninstall a release toolchain
103-
104-
```
105-
$ swiftly uninstall 5.6.3
106-
```
107-
108-
To uninstall all toolchains associated with a given minor release, leave off the patch version:
109-
27+
swiftly install main-snapshot
28+
swiftly use main-snapshot
29+
swift --version
30+
--
31+
Apple Swift version 6.2-dev (LLVM 059105ceb0cb60e, Swift 714c862d3791544)
32+
Target: arm64-apple-macosx15.0
33+
Build config: +assertions
11034
```
111-
$ swiftly uninstall 5.6
112-
```
113-
114-
#### Uninstall a snapshot toolchain
115-
116-
```
117-
$ swiftly uninstall main-snapshot-2022-08-30
118-
$ swiftly uninstall 5.7-snapshot-2022-08-30
119-
```
120-
121-
To uninstall all snapshots associated with a given branch (either main or a release branch), omit the date:
122-
123-
```
124-
$ swiftly uninstall main-snapshot
125-
$ swiftly uninstall 5.7-snapshot
126-
```
127-
128-
### Listing installed toolchains
129-
130-
The `list` command prints all the toolchains installed by swiftly:
131-
132-
```
133-
$ swiftly list
134-
```
135-
136-
### Selecting a toolchain for use
137-
138-
“Using” a toolchain sets it as the active toolchain, meaning it will be the one found via $PATH and invoked via `swift` commands executed in the shell. The toolchain must be installed before you can use it.
13935

140-
You can provide the same version selectors as you used with `swiftly install` to use a toolchain, including exact releacs versions "major.minor.patch", and snapshots.
36+
For more detailed usage guides there is [documentation](https://swiftpackageindex.com/swiftlang/swiftly/main/documentation/swiftlydocs).
14137

142-
```
143-
$ swiftly use latest
144-
$ swiftly use 5.3.1
145-
$ swiftly use 5.3
146-
$ swiftly use 5.3-snapshot
147-
$ swiftly use 5.3-snapshot-2022-08-16
148-
$ swiftly use main-snapshot
149-
$ swiftly use main-snapshot-2024-06-18
150-
```
151-
152-
After you use a toolchain your commands at the shell will run with that toolchain:
153-
154-
```
155-
$ swiftly use x.y.z
156-
$ swift build # Build my package with toolchain version x.y.z
157-
$ clang -c foo.c -o foo.o # Compile this C file using the clang compiler in toolchain version x.y.z
158-
$ lldb # Open the debugger from toolchain version x.y.z
159-
```
160-
161-
If you want to run just one command with a particular toolchain without having to switch back to the one you used previously you can use the `swiftly run` command with the version. This command builds your current package with the latest snapshot toolchain of the current release:
162-
163-
```
164-
$ swiftly run swift build +main-snapshot
165-
```
166-
167-
The parameter with the "+" indicates that this is the version selector of the toolchain to use and supports the full range of selectors shown above and with the `swiftly install` command. The toolchain must be installed to run a command with that toolchain.
168-
169-
### Updating a toolchain
170-
171-
Update replaces a given toolchain with a later version of that toolchain. For a stable release, this means updating to a later patch, minor, or major version. For snapshots, this means updating to the most recently available snapshot.
172-
173-
If no version is provided, update will update the currently selected toolchain to its latest patch release if a release toolchain or the latest available snapshot if a snapshot. The newly installed version will be selected.
174-
175-
```
176-
$ swiftly update
177-
```
178-
179-
To update the latest installed release version to the latest available release version, the “latest” version can be provided. Note that this may update the toolchain to the next minor or even major version.
180-
181-
```
182-
swiftly update latest
183-
```
184-
185-
If only a major version is specified, the latest installed toolchain with that major version will be updated to the latest available release of that major version:
186-
187-
```
188-
swiftly update 5
189-
```
190-
191-
If the major and minor version are specified, the latest installed toolchain associated with that major/minor version will be updated to the latest available patch release for that major/minor version.
192-
193-
```
194-
swiftly update 5.3
195-
```
196-
197-
You can also specify a full version to update that toolchain to the latest patch available for that major/minor version:
198-
199-
```
200-
swiftly update 5.3.1
201-
```
202-
203-
Similarly, to update the latest snapshot associated with a specific version, the “a.b-snapshot” version can be supplied:
204-
205-
```
206-
swiftly update 5.3-snapshot
207-
```
208-
209-
You can also update the latest installed main snapshot to the latest available one by just providing `main-snapshot`:
210-
211-
```
212-
swiftly update main-snapshot
213-
```
214-
215-
A specific snapshot toolchain can be updated to the newest available snapshot for that branch by including the date:
216-
217-
```
218-
swiftly update 5.9-snapshot-2023-09-20
219-
```
220-
221-
### Listing toolchains available to install
222-
223-
The `list-available` command can be used to list the latest toolchains that Apple has made available to install.
224-
225-
Note that this command isn't implemented yet, but it will be included in a future release.
226-
227-
```
228-
swiftly list-available
229-
```
38+
## Features
23039

231-
A selector can optionally be provided to narrow down the results:
40+
- [Installing multiple toolchains](https://swiftpackageindex.com/swiftlang/swiftly/main/documentation/swiftlydocs/install-toolchains), including both stable releases and snapshots
41+
- [Switching which installed toolchain is active](https://swiftpackageindex.com/swiftlang/swiftly/main/documentation/swiftlydocs/use-toolchains) (i.e. which one is discovered via `$PATH`)
42+
- [Updating installed toolchains](https://swiftpackageindex.com/swiftlang/swiftly/main/documentation/swiftlydocs/update-toolchain) to the latest available versions of those toolchains
43+
- [Uninstalling installed toolchains](https://swiftpackageindex.com/swiftlang/swiftly/main/documentation/swiftlydocs/uninstall-toolchains)
44+
- Listing the toolchains that are available to install with the `list-available` subcommand
45+
- Sharing the preferred toolchain as a project setting with a `.swift-version` file
46+
- Running a single command on a particular toolchain with the `run` subcommand
23247

233-
```
234-
$ swiftly list-available 5.6
235-
$ swiftly list-available main-snapshot
236-
$ swiftly list-available 5.7-snapshot
237-
```
48+
## Platform support
23849

239-
### Updating swiftly
50+
swiftly is supported on Linux and macOS. For more detailed information about swiftly's intended features and implementation, check out the [design document](DESIGN.md).
24051

241-
This command checks to see if there are new versions of `swiftly` itself and upgrades to them if so.
52+
## Updating swiftly
24253

243-
Note that this command isn't implemented yet, but it will be included in a future release.
54+
This command checks to see if there are new versions of `swiftly` itself and upgrades to them if possible.
24455

24556
`swiftly self-update`
24657

247-
### Specifying a snapshot toolchain
248-
249-
The canonical name for a snapshot toolchain in swiftly's command interface is the following:
250-
251-
```
252-
<branch>-snapshot-YYYY-MM-DD
253-
```
254-
255-
However, swiftly also accepts the snapshot toolchain filenames from the downloads provided by swift.org. For example:
256-
257-
```
258-
swift-DEVELOPMENT-SNAPSHOT-2022-09-10-a
259-
swift-5.7-DEVELOPMENT-SNAPSHOT-2022-08-30-a
260-
```
261-
262-
The canonical name format was chosen to reduce the keystrokes needed to refer to a snapshot toolchain, but the longer form is also useful when copy/pasting a toolchain name provided from somewhere else.
263-
26458
## Contributing
26559
Welcome to the Swift community!
26660

@@ -280,13 +74,13 @@ Swift.org currently provides experimental [`.rpm` and `.deb`](https://forums.swi
28074

28175
swiftenv is an existing Swift version manager which already has much of the functionality that swiftly will eventually have. It's an awesome tool, and if it's part of your workflow then we encourage you to keep using it! That said, swiftly is/will be different a few ways:
28276

283-
- swiftly is being built as a community driven effort led by the Swift server workgroup, and through this collaboration, swiftly will eventually become an official installation tool for Swift toolchains. As first step towards that, swiftly will help inform the creation of API endpoints maintained by the Swift project that it will use to retrieve information about what toolchains are available to install and to verify their expected signatures. swiftenv currently uses a third party API layer for this. Using an official API reduces the avenues for security vulnerabilities and also reduces the risk of downtime affecting Swift installations.
77+
- swiftly is being built as a community driven effort, and through this collaboration, swiftly is an official installation tool for Swift toolchains. swiftly has helped ton inform the creation of API endpoints maintained by the Swift project that it uses to retrieve information about what toolchains are available to install and to verify their expected signatures. swiftenv currently uses a third party API layer for this. Using an official API reduces the avenues for security vulnerabilities and also reduces the risk of downtime affecting Swift installations.
28478

28579
- swiftly will be written in Swift, which we think is important for maintainability and encouraging community contributions.
28680

28781
- swiftly has first-class support for installing and managing snapshot toolchains.
28882

28983
- swiftly has built in support for updating toolchains.
29084

291-
- swiftly is optimized for ease of installation--it can be done with a bash one-liner similar to Homebrew and rustup. In addition, swiftly won't require any system dependencies to be installed on the user's system. While swiftenv is also relatively easy to install, it does involve cloning a git repository or using Homebrew, and it requires a few system dependencies (e.g. bash, curl, tar).
85+
- swiftly is optimized for ease of installation. In addition, swiftly doesn't require any system dependencies to be installed on the user's system. While swiftenv is also relatively easy to install, it does involve cloning a git repository or using Homebrew, and it requires a few system dependencies (e.g. bash, curl, tar).
29286

0 commit comments

Comments
 (0)