Bit is open source and distributed, Scopes can be set up on any machine.
You are welcome to host your Scopes and components on bitsrc.io, the free community hub for Bit. bitsrc.io provides many features, including Scope permissions, component search engine, auto-parsed docs and examples, test results and live rendering for React components.
Before working with bitsrc.io you will first need to configure your Bit client and SSH connectivity.
Configure your local Bit client
To set your username and email in Bit, use the bit config command.
Using Git config
If you already have a configuration for
git config, Bit will automatically use the predefined properties in Git.
$ bit config set user.name "mickey mouse" $ bit config set user.email firstname.lastname@example.org
Set up bitsrc.io connectivity
Signup to bitsrc.io
Connect Bit CLI to your Bit account
Bit uses SSH to authenticate a computer with your account, so Bit can authentication with the Scopes hosted on bitsrc.io.
SSH access to servers is already set up in most cases – and if it isn’t, it’s easy to do. SSH is also an authenticated network protocol; and because it’s ubiquitous, it’s generally easy to set up and use. This makes SSH the preferred method for collaboration.
There are two methods to authenticate a local Bit client to your bitsrc.io account.
- bit login command - This generates an authentication token for your bitsrc.io account, configures it to the local Bit client and uses that token to initiate an SSH connection.
- SSH key-pair - Generate an SSH key pair, upload the public part to your bitsrc.io account, and configure your Bit client to use the private part.
Authenticating Bit using ‘bit login’
To authenticate your Bit client, run the following command:
$ bit login Your browser has been opened to visit: http://bitsrc.io/bit-login?redirect_uri=http://localhost:8085...
Logging out from Bit
To quickly logout from Bit, run the bit logout command.
Managing your authentication devices
Here you can remove tokens, thus forcing Bit clients to re-authenticate themselves with your account.
Authenticating Bit using SSH key-pair
If you know how to generate your SSH key, you can skip the next part and move directly to authenticate your SSH Key to bitsrc.io.
Generate SSH key for macOS/Linux
To generate an SSH key follow these steps:
- Open a terminal application.
- Run this command (replace ‘email’ with the email associated with your BitSrc account):
ssh-keygen -t rsa -b 4096 -C "email@example.com"
- Accept the default location for the key file.
- To add a private key to the SSH-agent please follow the steps below:
Start the SSH agent:
eval "$(ssh-agent -s)"
Add the private key we’ve created in the last step:
Generate SSH key for Windows
To generate an SSH key, please follow these steps:
- Download and start the puttygen.exe generator.
- In the “Parameters” section choose SSH2 DSA and press Generate.
- Move your mouse on the small screen in order to generate the key pairs.
- Enter a key comment, which will identify the key (useful when you use several SSH keys).
- Click “Save private key” to save your private key.
- Click “Save public key” to save your public key.
Upload public SSH key to bitsrc.io
- First, you should log in to your bitsrc.io account.
- Click on your user icon to open your user actions menu:
- Click on the ‘Settings’ link to reach your user settings section. Once inside, click on ‘SSH Keys’ in the left pane:
- In the ‘SSH Keys’ section, you will notice that there are no SSH keys associated with your account. Click on ‘new SSH key’:
- In the ‘new SSH key’ form, type in a name for the key. The key name documents the key, and will not affect the behavior of the system.
To Fill the ‘Key’ form, go back to where you created your SSH key pair on your machine, and copy the content of the file named id_rds.pub. Paste it in the form.
Click on ‘Add SSH key’ to submit. You will now see a new item in the SSH key list:
You are now connected via SSH and can export and import components from the bitsrc.io community hub.