import Reptoid from '@reptoid/codebases'
const reptoid = new Reptoid({ accessToken: '<YOUR_TOKEN>' })
const { accountId } = await.reptoid.accounts().create()
await reptoid
.accountId(accountId)
.github()
.setAccessToken(accessToken)
const {
accountId,
email,
githubLogin,
accessToken,
} = await reptoid.github().authByCode(code)
const { workspaceId } = await reptoid
.account(accountId)
.workspaces()
.create()
const { workspaceId } = await reptoid
.account(accountId)
.github()
.clone('xreptoid/viperfish')
echo $YOUR_KERBEROS_TOKEN | kinit $YOUR_USERAME@reptoid.com
mount \
-t nfs4 \
-o sec=krb5p,timeo=600 \
nfs.reptoid.com:/w/$WORKSPACE_ID \
~/workspace
echo 'Hello, world!' > ~/workspace/test.txt
// write
await reptoid
.account(accountId)
.workspace(workspaceId)
.files('/test.txt')
.write('Hello, world!')
// read
const content = await reptoid
.account(accountId)
.workspace(workspaceId)
.files('/test.txt')
.read()
// create new repo & set origin
await reptoid
.account(accountId)
.github()
.create('your-org/test-repo')
await reptoid
.account(accountId)
.workspace(workspaceId)
.github()
.setOrigin('your-org/test-repo')
// commit & push
await reptoid.account(accountId).workspace(workspaceId).addAll()
await reptoid.account(accountId).workspace(workspaceId).commit({ message: 'Test commit' })
await reptoid.account(accountId).workspace(workspaceId).push()