1.0.0-beta.59 • Published 4 years ago
@dxos/chess-cli v1.0.0-beta.59
chess-cli
This is a CLI extension for playing chess games. Core model is located at Chess Core.
Initial linking
Until this issue is resolved, there are some step required in order to run/develop this extension outside of the incubator
repository:
- Link the chess cli package:
cd packages/chess-cli
yarn link
- Use the linked cli package in incubator:
cd incubator
yarn link "@dxos/chess-cli"
- That should solve the issue for now
Running the CLI
Chess CLI is operable within a party, so one needs to create or join a party:
yarn wire party create
Connecting to a browser party
- Create the party in the browser
- Copy the party ID
- Create the invite link
- Join the party from CLI:
yarn wire party join <party ID> --url <copied invite URL>
Available commands
Create
Create new game:
[wire]> chess create <title>
{"id":1588255463315}
List
List existing games:
[wire]> chess list
[wire]> [{"__type_url":"testing.chess.Game","id":1588255463315,"title":"Sef."}]
Join
Join an existing game:
[wire]> chess join 1588255463315
[wire]> [{"__type_url":"testing.chess.Game","id":1588255463315,"title":"Sef."}]
Move
Make a move:
chess move <from> <to>
Example:
[wire]> chess move a2 a3
[wire]>
+------------------------+
8 | r n b q k b n r |
7 | p p p p p p p p |
6 | . . . . . . . . |
5 | . . . . . . . . |
4 | . . . . . . . . |
3 | P . . . . . . . |
2 | . P P P P P P P |
1 | R N B Q K B N R |
+------------------------+
a b c d e f g h
1.0.0-beta.59
4 years ago