Skip to content

Commit

Permalink
[Docs] - Add info about teams to CLI docs (#418)
Browse files Browse the repository at this point in the history
Add section about team in CLI
  • Loading branch information
jakubno committed Aug 5, 2024
2 parents dfa4970 + 1883388 commit 2535fba
Show file tree
Hide file tree
Showing 15 changed files with 6,569 additions and 8,354 deletions.
3 changes: 3 additions & 0 deletions apps/web/src/app/(auth)/auth/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Footer } from '@/components/Footer'

export default async function Layout({ children }) {
return (
<div className="pt-12">
{children}
<Footer />
</div>
)
}
23 changes: 23 additions & 0 deletions apps/web/src/app/(docs)/docs/cli/commands/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ Log out of the CLI. It will remove your access token from `~/.e2b` file.
e2b auth logout
```

## `auth configure`

Configure the default team for the CLI. It will be used for all commands that require a team.

```bash
e2b auth configure
```

## `auth info`

Get info about your current user.
Expand Down Expand Up @@ -103,6 +111,9 @@ If there is no `e2b.toml` config a new template will be created.
<Option type="-d, --dockerfile" name="dockerfile">
Specify the path to Dockerfile. By default E2B tries to find `e2b.Dockerfile` or `Dockerfile` in the root directory.
</Option>
<Option type="-t, --team" name="team">
Specify the team that will be used for the sandbox template. You can find team ID in the team settings in the [E2B dashboard](https://e2b.dev/dashboard?tab=team).
</Option>
<Option type="--cpu-count" name="cpu-count">
Specify the number of CPUs that will be used to run the sandbox. The default value is 2.
</Option>
Expand Down Expand Up @@ -153,6 +164,9 @@ Running `e2b template delete` without specifying a template with the `[template]
<Option type="-y, --yes">
Don't ask for confirmation before deleting the sandbox template.
</Option>
<Option type="-t, --team" name="team">
Specify the team that will be used for the sandbox template. You can find team ID in the team settings in the (E2B dashboard)[https://e2b.dev/dashboard?tab=team].
</Option>
</Options>


Expand All @@ -164,6 +178,15 @@ List your sandbox templates.
e2b template list
```

#### **Options**

<Options>
<Option type="-t, --team" name="team">
Specify the team that will be used for the sandbox template. You can find team ID in the team settings in the (E2B dashboard)[https://e2b.dev/dashboard?tab=team].
</Option>
</Options>


---

# Sandboxes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Code Interpreter SDK Beta - Language Runtimes

This guide shows how to run AI-generated code in different language runtimes using the new Code Interpreter beta SDK.
The following language runtimes are currently supported:
- **Python**
- **JavaScript**
- **Java**
- **Bash**
- **R**

<Note>
Want more language runtimes? Reached out to us on [Discord](https://discord.gg/U7KEcGErtQ) or over [email](emailto:[email protected]).
</Note>

## 1. Install the Code Interpreter beta SDK
The latest beta versions you should install can be found in NPM/PyPi release history:
- **JavaScript & TypeScript**
- [Latest release](https://www.npmjs.com/package/@e2b/code-interpreter?activeTab=versions) with *rc* tag for `@e2b/code-interpreter`
- **Python**
- [Latest release](https://pypi.org/project/e2b-code-interpreter/#history) with *PRE-RELEASE* for `e2b-code-interpreter`


## 2. Active kernel for the desired language
Each of the supported language runtimes has its own kernel.

**Python**
```python
from e2b_code_interpreter import CodeInterpreter

sandbox = CodeInterpreter()

# 1. Set JS kernel - available kernel names: 'r', 'javascript', 'java', 'bash'
js_id = sandbox.notebook.create_kernel(kernel_name="javascript")
# 2. Run JS code inside code interpreter!
execution = sandbox.notebook.exec_cell("console.log('Hello World!')", kernel_id=js_id)
print(execution)
# 3. Use Python again
sandbox.notebook.exec_cell("print('Hello World!')")
```

**JavaScript / TypeScript**
```js
import { CodeInterpreter } from '@e2b/code-interpreter'

const sandbox = await CodeInterpreter.create()

// 1. Set JS kernel - available kernel names: 'r', 'javascript', 'java', 'bash'
const jsID = await sandbox.notebook.createKernel({ kernelName: 'javascript' })
// 2. Run JS code inside code interpreter!
const execution = await sandbox.notebook.execCell("console.log('Hello World!')", { kernelID: jsID })
console.log(execution)
// 3. Use Python again
await sandbox.notebook.execCell('print("Hello World!")')
```
4 changes: 2 additions & 2 deletions apps/web/src/app/(docs)/docs/guide/beta-migration/page.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SDK Beta Migration Guide
# SDK Beta - Migration Guide
The following guide shows how to migrate your code from the current Core SDKs (`e2b`) and Code Interpreter SDKs (`@e2b/code-interpreter`/`e2b-code-interpreter`) to the beta versions.

The latest beta versions you should install can be found in NPM/PyPi release history:
Expand Down Expand Up @@ -173,7 +173,7 @@ import Sandbox from 'e2b'

// Before
// const content = fs.readFileSync('/local/path')
// await sandbox.uploadFile(content, '/path/in/sandbox')
// await sandbox.uploadFile(content, '/path/in/sandbox')

// Now
const content = fs.readFileSync('/local/path')
Expand Down
32 changes: 0 additions & 32 deletions apps/web/src/app/(docs)/docs/layout.tsx

This file was deleted.

27 changes: 25 additions & 2 deletions apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import { PostHogAnalytics } from '@/utils/usePostHog'
import Canonical from '@/components/Navigation/canonical'
import { Suspense } from 'react'
import { Header } from '@/components/Header'
import glob from 'fast-glob'
import { Section } from '@/components/SectionProvider'
import { Layout } from '@/components/Layout'

export const metadata: Metadata = {
// TODO: Add metadataBase
Expand All @@ -28,7 +31,27 @@ export const metadata: Metadata = {
},
}

declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace JSX {
interface IntrinsicElements {
'chatlio-widget': any;
}
}
}


export default async function RootLayout({ children }) {
const pages = await glob('**/*.mdx', { cwd: 'src/app/(docs)/docs' })
const allSectionsEntries = (await Promise.all(
pages.map(async filename => [
'/docs/' + filename.replace(/\(docs\)\/?|(^|\/)page\.mdx$/, ''),
(await import(`./(docs)/docs/${filename}`)).sections,
]),
)) as Array<[string, Array<Section>]>
const allSections = Object.fromEntries(allSectionsEntries)


return (
<html
lang="en"
Expand All @@ -40,10 +63,10 @@ export default async function RootLayout({ children }) {
</head>
<body className="flex min-h-full bg-white antialiased dark:bg-zinc-900">
<Providers>
<div className="w-full">
<Layout allSections={allSections}>
<Header />
{children}
</div>
</Layout>
<Suspense>
<PostHogAnalytics />
</Suspense>
Expand Down
5 changes: 2 additions & 3 deletions apps/web/src/components/AuthForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { useUser } from '@/utils/useUser'

const supabase = createClientComponentClient()


export interface Props {
view: 'sign_in' | 'sign_up' | 'forgotten_password'
}
Expand Down Expand Up @@ -72,7 +71,7 @@ function AuthForm({ view }: Props) {
{(view === 'sign_up' || view === 'forgotten_password') &&
<div className="flex items-center justify-start gap-2">
<span className="text-zinc-400">Already have an account?</span>
<Link className="flex items-center justify-center" href="/auth/sign-in">
<Link className="flex items-center justify-center" href={`/auth/sign-in?redirect_to=${redirectTo}`}>
<Button
variant="textLink"
>
Expand All @@ -95,7 +94,7 @@ function AuthForm({ view }: Props) {
{view === 'sign_in' &&
<div className="flex items-center justify-start gap-2">
<span className="text-zinc-400">{'Don\'t have an account?'}</span>
<Link href="/auth/sign-up">
<Link href={`/auth/sign-up?redirect_to=${redirectTo}`}>
<Button
variant="textLink"
>
Expand Down
78 changes: 0 additions & 78 deletions apps/web/src/components/BentoGrid.tsx

This file was deleted.

8 changes: 5 additions & 3 deletions apps/web/src/components/Dashboard/Billing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ export const BillingContent = ({ currentApiKey, team }: { currentApiKey: string
</div>
<ul className='flex flex-col list-disc list-inside text-neutral-400'>
<li>One-time $100 credits</li>
<li>Community support</li>
<li>Up to 1 hour sandbox session length</li>
<li>Up to 20 concurrently running sandboxes</li>
<li>Dedicated Slack channel with live Pro support from our team</li>
<li>Prioritized features</li>
<li>Customize your <Link className="text-[#ff8800] underline" href="/docs/sandbox/compute">sandbox compute</Link></li>
<li>Up to 24 hours sandbox session length</li>
<li>Up to 100 concurrently running sandboxes</li>
</ul>
</div>

Expand Down
Loading

0 comments on commit 2535fba

Please sign in to comment.