Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
fd5e6a7
git implementation for python started
matthewlouisbrockman Jan 27, 2026
9221a9b
js git implementation
matthewlouisbrockman Jan 27, 2026
2df2fac
test for git available
matthewlouisbrockman Jan 27, 2026
57f6cfb
python git not present tests
matthewlouisbrockman Jan 27, 2026
cf53d80
add git dangeously authenticate to persist auth
matthewlouisbrockman Jan 27, 2026
3777387
general git configs
matthewlouisbrockman Jan 27, 2026
093b305
vscode keeps readding the mise-tools settings json so i guess im putt…
matthewlouisbrockman Jan 27, 2026
fa958c4
can run git init
matthewlouisbrockman Jan 27, 2026
406a3bb
need remote add to create repos
matthewlouisbrockman Jan 27, 2026
c8cf003
create repo works
matthewlouisbrockman Jan 27, 2026
5ffd334
cleanup: rm extra/confusing create_repo from experimenting, leave onl…
matthewlouisbrockman Jan 27, 2026
75a6ba6
bugfix: allow going off global token for git operations
matthewlouisbrockman Jan 27, 2026
a6a1785
security: credentials by default not stored
matthewlouisbrockman Jan 27, 2026
beb61c1
security: clean up token requirements and error messages
matthewlouisbrockman Jan 27, 2026
fcae53b
change to settings.json wasn't needed
matthewlouisbrockman Jan 27, 2026
8c48307
git utils: detect detached HEAD status
matthewlouisbrockman Jan 27, 2026
b8a7359
git: refine auth failure detection
matthewlouisbrockman Jan 27, 2026
039042f
git: fetch after updating remote
matthewlouisbrockman Jan 27, 2026
94504c5
git: create GitHub repos from sandbox
matthewlouisbrockman Jan 27, 2026
9c6bae3
ruff fixes
matthewlouisbrockman Jan 27, 2026
ef0b2fe
fix js format
matthewlouisbrockman Jan 27, 2026
a9c34cb
add changeset
matthewlouisbrockman Jan 27, 2026
fa98b4f
python tests improved to use in-sandbox git repo
matthewlouisbrockman Jan 28, 2026
cad6aa3
pytest ignores the coroutpine warnings
matthewlouisbrockman Jan 28, 2026
9e473d7
individual ts tests
matthewlouisbrockman Jan 28, 2026
79d75dc
tests shouldn't use debug, use whatever the runner's using (no localh…
matthewlouisbrockman Jan 28, 2026
9bf9ef0
use pytest.mark.skip_debug() on all the ones requiring a sandbox
matthewlouisbrockman Jan 28, 2026
3ef13b7
ran ruff
matthewlouisbrockman Jan 28, 2026
c9b80d6
js linter run
matthewlouisbrockman Jan 28, 2026
b4db10b
handle missing upstream
matthewlouisbrockman Jan 28, 2026
b226951
instructinos for install; mise / pipx issues
matthewlouisbrockman Jan 28, 2026
6fca2e0
security: explain git available to people with access to sandbox
matthewlouisbrockman Jan 28, 2026
3fd895a
feat: add git status is_clean helper
matthewlouisbrockman Jan 28, 2026
eeef5e6
feat: add git status helper counts
matthewlouisbrockman Jan 28, 2026
bc98251
typo: first class support
matthewlouisbrockman Jan 28, 2026
d632919
bugfix: use getEnvVar helper instead of directly accessing process.env
matthewlouisbrockman Jan 28, 2026
23cab1c
feat: add git reset helper
matthewlouisbrockman Jan 28, 2026
3633469
feat: add git restore helper
matthewlouisbrockman Jan 28, 2026
74ca22c
cleanup: linter + formatter
matthewlouisbrockman Jan 28, 2026
9dfa003
undo changes to dev.md
matthewlouisbrockman Jan 28, 2026
285b085
rm github create repo
matthewlouisbrockman Jan 28, 2026
05a3eee
early check password / username
matthewlouisbrockman Jan 28, 2026
27bb540
support remoteadd
matthewlouisbrockman Jan 28, 2026
1d9b62b
allow overriding config author/email but not force check
matthewlouisbrockman Jan 28, 2026
fb937e4
default "-A" on git add
matthewlouisbrockman Jan 28, 2026
5955e43
run renamed to runGit/run_git to distinuish from shell commands
matthewlouisbrockman Jan 28, 2026
a19c261
configset/get changed to set/getconfig
matthewlouisbrockman Jan 28, 2026
26bc4f9
git config scope configurable
matthewlouisbrockman Jan 28, 2026
c74ac4e
js scope flag just uses --{scope} like the python one
matthewlouisbrockman Jan 28, 2026
6e95446
formatter was wrong
matthewlouisbrockman Jan 28, 2026
0c10952
git auth errors when bad auth
matthewlouisbrockman Jan 28, 2026
4ce3fec
don't all:true is default now can remove from test
matthewlouisbrockman Jan 28, 2026
d1bc924
changes to push - default set-upstream true, helpers outside functions
matthewlouisbrockman Jan 28, 2026
fe15083
apparently this space was needed for the format
matthewlouisbrockman Jan 28, 2026
cd70974
js status tests
matthewlouisbrockman Jan 28, 2026
2e472cd
python status tests extended
matthewlouisbrockman Jan 28, 2026
cb10215
consolidate tests around purpose
matthewlouisbrockman Jan 28, 2026
db5611c
rename config tests
matthewlouisbrockman Jan 28, 2026
ddb69ea
formatting fix
matthewlouisbrockman Jan 28, 2026
00f0fbf
add tests on getters that use the sandbox.git commands while leaving …
matthewlouisbrockman Jan 28, 2026
1eb1b64
add concept of GitUpstreamException
matthewlouisbrockman Jan 28, 2026
997e1f0
change naming on attemptClone to make it easier to read
matthewlouisbrockman Jan 28, 2026
66a8f3b
stick with npx changeset; works with some users
matthewlouisbrockman Jan 28, 2026
8078854
rm defaults from tests for upstream, all
matthewlouisbrockman Jan 29, 2026
aa5aac3
rm the secure=False from the factory
matthewlouisbrockman Jan 29, 2026
b5e1f80
rm force on create/delete branch tests
matthewlouisbrockman Jan 29, 2026
fc52d3a
re-undo the dev reversion
matthewlouisbrockman Jan 29, 2026
2f17e71
break out more utils from main git packages
matthewlouisbrockman Jan 29, 2026
6aa248e
further test reconsolidation
matthewlouisbrockman Jan 29, 2026
3f2c972
linters - my thing is not set up to autolint correctly
matthewlouisbrockman Jan 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/odd-drinks-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@e2b/python-sdk': minor
'e2b': minor
---

Adds first class support to git commands to the sandbox sdk.
20 changes: 20 additions & 0 deletions packages/js-sdk/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,26 @@ export class AuthenticationError extends Error {
}
}

/**
* Thrown when git authentication fails.
*/
export class GitAuthError extends AuthenticationError {
constructor(message: string) {
super(message)
this.name = 'GitAuthError'
}
}

/**
* Thrown when git upstream tracking is missing.
*/
export class GitUpstreamError extends SandboxError {
constructor(message: string, stackTrace?: string) {
super(message, stackTrace)
this.name = 'GitUpstreamError'
}
}

/**
* Thrown when the template uses old envd version. It isn't compatible with the new SDK.
*/
Expand Down
21 changes: 21 additions & 0 deletions packages/js-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export { ConnectionConfig } from './connectionConfig'
export type { ConnectionOpts, Username } from './connectionConfig'
export {
AuthenticationError,
GitAuthError,
GitUpstreamError,
InvalidArgumentError,
NotEnoughSpaceError,
NotFoundError,
Expand Down Expand Up @@ -62,6 +64,25 @@ export type {
Pty,
} from './sandbox/commands'

export { Git } from './sandbox/git'
export type {
GitRequestOpts,
GitCloneOpts,
GitInitOpts,
GitRemoteAddOpts,
GitCommitOpts,
GitAddOpts,
GitDeleteBranchOpts,
GitPushOpts,
GitPullOpts,
GitDangerouslyAuthenticateOpts,
GitConfigOpts,
GitConfigScope,
GitBranches,
GitFileStatus,
GitStatus,
} from './sandbox/git'

export { Sandbox }
import { Sandbox } from './sandbox'

Expand Down
Loading